interface TransformerProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Logs.TransformerProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#TransformerProps |
Java | software.amazon.awscdk.services.logs.TransformerProps |
Python | aws_cdk.aws_logs.TransformerProps |
TypeScript (source) | aws-cdk-lib » aws_logs » TransformerProps |
The Resource properties for AWS::Logs::Transformer resource.
This interface defines all configuration options for the CfnTransformer construct.
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 |
|---|---|---|
| log | ILog | Existing log group that you want to associate with this transformer. |
| transformer | IProcessor[] | List of processors in a transformer. |
| transformer | string | Name of the transformer. |
logGroup
Type:
ILog
Existing log group that you want to associate with this transformer.
transformerConfig
Type:
IProcessor[]
List of processors in a transformer.
transformerName
Type:
string
Name of the transformer.

.NET
Go
Java
Python
TypeScript (