interface AddKeysProperty
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Logs.AddKeysProperty |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#AddKeysProperty |
![]() | software.amazon.awscdk.services.logs.AddKeysProperty |
![]() | aws_cdk.aws_logs.AddKeysProperty |
![]() | aws-cdk-lib » aws_logs » AddKeysProperty |
This processor adds new key-value pairs to the log event.
For more information about this processor including examples, see addKeys in the CloudWatch Logs User Guide.
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 |
---|---|---|
entries | Add [] | An array of objects, where each object contains information about one key to add to the log event. |
entries
Type:
Add
[]
An array of objects, where each object contains information about one key to add to the log event.