JsonMutatorProps
- class aws_cdk.aws_logs.JsonMutatorProps(*, type, add_keys_options=None, copy_value_options=None, delete_keys_options=None, list_to_map_options=None, move_keys_options=None, rename_keys_options=None)
Bases:
BaseProcessorProps
Properties for creating JSON mutator processors.
- Parameters:
type (
JsonMutatorType
) – The type of JSON mutation operation.add_keys_options (
Union
[AddKeysProperty
,Dict
[str
,Any
],None
]) – Options for adding keys. Required when type is ADD_KEYS. Default: - No adding keys processor is created if props not setcopy_value_options (
Union
[CopyValueProperty
,Dict
[str
,Any
],None
]) – Options for copying values. Required when type is COPY_VALUE. Default: - No copy value processor is created if props not setdelete_keys_options (
Union
[ProcessorDeleteKeysProperty
,Dict
[str
,Any
],None
]) – Keys to delete. Required when type is DELETE_KEYS. Default: - No delete key processor is created if props not setlist_to_map_options (
Union
[ListToMapProperty
,Dict
[str
,Any
],None
]) – Options for converting lists to maps. Required when type is LIST_TO_MAP. Default: - No list-to-map processor is created if props not setmove_keys_options (
Union
[MoveKeysProperty
,Dict
[str
,Any
],None
]) – Options for moving keys. Required when type is MOVE_KEYS. Default: - No move key processor is created if props not setrename_keys_options (
Union
[RenameKeysProperty
,Dict
[str
,Any
],None
]) – Options for renaming keys. Required when type is RENAME_KEYS. Default: - No rename key processor is created if props not set
- 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_options
Options for adding keys.
Required when type is ADD_KEYS.
- Default:
No adding keys processor is created if props not set
- copy_value_options
Options for copying values.
Required when type is COPY_VALUE.
- Default:
No copy value processor is created if props not set
- delete_keys_options
Keys to delete.
Required when type is DELETE_KEYS.
- Default:
No delete key processor is created if props not set
- list_to_map_options
Options for converting lists to maps.
Required when type is LIST_TO_MAP.
- Default:
No list-to-map processor is created if props not set
- move_keys_options
Options for moving keys.
Required when type is MOVE_KEYS.
- Default:
No move key processor is created if props not set
- rename_keys_options
Options for renaming keys.
Required when type is RENAME_KEYS.
- Default:
No rename key processor is created if props not set
- type
The type of JSON mutation operation.