enum JsonMutatorType
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Logs.JsonMutatorType |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#JsonMutatorType |
![]() | software.amazon.awscdk.services.logs.JsonMutatorType |
![]() | aws_cdk.aws_logs.JsonMutatorType |
![]() | aws-cdk-lib » aws_logs » JsonMutatorType |
Types of JSON mutation operations.
Defines operations that can be performed to modify the JSON structure of log events.
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]
});
Members
Name | Description |
---|---|
ADD_KEYS | Add new keys to the log event. |
DELETE_KEYS | Delete keys from the log event. |
MOVE_KEYS | Move keys to different locations. |
RENAME_KEYS | Rename keys in the log event. |
COPY_VALUE | Copy values between keys. |
LIST_TO_MAP | Convert a list to a map. |
ADD_KEYS
Add new keys to the log event.
DELETE_KEYS
Delete keys from the log event.
MOVE_KEYS
Move keys to different locations.
RENAME_KEYS
Rename keys in the log event.
COPY_VALUE
Copy values between keys.
LIST_TO_MAP
Convert a list to a map.