Skip to content
v2.274.0

TransformerProps Struct ​

The Resource properties for AWS::Logs::Transformer resource.

This interface defines all configuration options for the CfnTransformer construct.

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 ​

logGroupILogGroupReflog_groupILogGroupReflogGroupILogGroupRefLogGroupILogGroupRefLogGroupILogGroupRefrequired#
Existing log group that you want to associate with this transformer.
transformerConfigIProcessor[]transformer_configtyping.List[IProcessor]transformerConfigList<IProcessor>TransformerConfigIProcessor[]TransformerConfig*[]IProcessorrequired#
List of processors in a transformer.
transformerNamestringtransformer_namestrtransformerNameStringTransformerNamestringTransformerName*stringrequired#
Name of the transformer.