JsonMutatorType
- class aws_cdk.aws_logs.JsonMutatorType(*values)
Bases:
EnumTypes of JSON mutation operations.
Defines operations that can be performed to modify the JSON structure of log events.
- ExampleMetadata:
infused
Example:
# Create a log group log_group = logs.LogGroup(self, "MyLogGroup") # Create a JSON parser processor json_parser = logs.ParserProcessor( type=logs.ParserProcessorType.JSON ) # Create a processor to add keys add_keys_processor = logs.JsonMutatorProcessor( type=logs.JsonMutatorType.ADD_KEYS, add_keys_options=logs.AddKeysProperty( entries=[logs.AddKeyEntryProperty( key="metadata.transformed_in", value="CloudWatchLogs" )] ) ) # Create a transformer with these processors logs.Transformer(self, "Transformer", transformer_name="MyTransformer", log_group=log_group, transformer_config=[json_parser, add_keys_processor] )
Attributes
- ADD_KEYS
Add new keys to the log event.
- COPY_VALUE
Copy values between keys.
- DELETE_KEYS
Delete keys from the log event.
- LIST_TO_MAP
Convert a list to a map.
- MOVE_KEYS
Move keys to different locations.
- RENAME_KEYS
Rename keys in the log event.