JsonMutatorProps Struct
Properties for creating JSON mutator processors.
Example
ts
// Create a log group
const logGroup = new logs.LogGroup(this, 'MyLogGroup');
// Create a JSON parser processor
const jsonParser = new logs.ParserProcessor({
type: logs.ParserProcessorType.JSON
});
// Create a processor to add keys
const addKeysProcessor = new logs.JsonMutatorProcessor({
type: logs.JsonMutatorType.ADD_KEYS,
addKeysOptions: {
entries: [{
key: 'metadata.transformed_in',
value: 'CloudWatchLogs'
}]
}
});
// Create a transformer with these processors
new logs.Transformer(this, 'Transformer', {
transformerName: 'MyTransformer',
logGroup: logGroup,
transformerConfig: [jsonParser, addKeysProcessor]
});
Properties
addKeysOptionsAddKeysPropertyadd_keys_optionsAddKeysPropertyaddKeysOptionsAddKeysPropertyAddKeysOptionsAddKeysPropertyAddKeysOptionsAddKeysProperty= No adding keys processor is crea…#Options for adding keys.
Required when type is ADD_KEYS.
default
Default: No adding keys processor is created if props not set
copyValueOptionsCopyValuePropertycopy_value_optionsCopyValuePropertycopyValueOptionsCopyValuePropertyCopyValueOptionsCopyValuePropertyCopyValueOptionsCopyValueProperty= No copy value processor is creat…#Options for copying values.
Required when type is COPY_VALUE.
default
Default: No copy value processor is created if props not set
deleteKeysOptionsProcessorDeleteKeysPropertydelete_keys_optionsProcessorDeleteKeysPropertydeleteKeysOptionsProcessorDeleteKeysPropertyDeleteKeysOptionsProcessorDeleteKeysPropertyDeleteKeysOptionsProcessorDeleteKeysProperty= No delete key processor is creat…#Keys to delete.
Required when type is DELETE_KEYS.
default
Default: No delete key processor is created if props not set
listToMapOptionsListToMapPropertylist_to_map_optionsListToMapPropertylistToMapOptionsListToMapPropertyListToMapOptionsListToMapPropertyListToMapOptionsListToMapProperty= No list-to-map processor is crea…#Options for converting lists to maps.
Required when type is LIST_TO_MAP.
default
Default: No list-to-map processor is created if props not set
moveKeysOptionsMoveKeysPropertymove_keys_optionsMoveKeysPropertymoveKeysOptionsMoveKeysPropertyMoveKeysOptionsMoveKeysPropertyMoveKeysOptionsMoveKeysProperty= No move key processor is created…#Options for moving keys.
Required when type is MOVE_KEYS.
default
Default: No move key processor is created if props not set
renameKeysOptionsRenameKeysPropertyrename_keys_optionsRenameKeysPropertyrenameKeysOptionsRenameKeysPropertyRenameKeysOptionsRenameKeysPropertyRenameKeysOptionsRenameKeysProperty= No rename key processor is creat…#Options for renaming keys.
Required when type is RENAME_KEYS.
default
Default: No rename key processor is created if props not set
typeJsonMutatorTypetypeJsonMutatorTypetypeJsonMutatorTypeTypeJsonMutatorTypeTypeJsonMutatorTyperequired#The type of JSON mutation operation.