interface JsonMutatorProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Logs.JsonMutatorProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#JsonMutatorProps |
![]() | software.amazon.awscdk.services.logs.JsonMutatorProps |
![]() | aws_cdk.aws_logs.JsonMutatorProps |
![]() | aws-cdk-lib » aws_logs » JsonMutatorProps |
Properties for creating JSON mutator processors.
Example
// 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
Name | Type | Description |
---|---|---|
type | Json | The type of JSON mutation operation. |
add | Add | Options for adding keys. |
copy | Copy | Options for copying values. |
delete | Processor | Keys to delete. |
list | List | Options for converting lists to maps. |
move | Move | Options for moving keys. |
rename | Rename | Options for renaming keys. |
type
Type:
Json
The type of JSON mutation operation.
addKeysOptions?
Type:
Add
(optional, default: No adding keys processor is created if props not set)
Options for adding keys.
Required when type is ADD_KEYS.
copyValueOptions?
Type:
Copy
(optional, default: No copy value processor is created if props not set)
Options for copying values.
Required when type is COPY_VALUE.
deleteKeysOptions?
Type:
Processor
(optional, default: No delete key processor is created if props not set)
Keys to delete.
Required when type is DELETE_KEYS.
listToMapOptions?
Type:
List
(optional, default: No list-to-map processor is created if props not set)
Options for converting lists to maps.
Required when type is LIST_TO_MAP.
moveKeysOptions?
Type:
Move
(optional, default: No move key processor is created if props not set)
Options for moving keys.
Required when type is MOVE_KEYS.
renameKeysOptions?
Type:
Rename
(optional, default: No rename key processor is created if props not set)
Options for renaming keys.
Required when type is RENAME_KEYS.