Class CfnTransformerPropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.logs.CfnTransformerPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:20:01.200Z") @Stability(Stable) public class CfnTransformerPropsMixin extends Mixin implements software.constructs.IMixin
Creates or updates a log transformer for a single log group.

You use log transformers to transform log events into a different format, making them easier for you to process and analyze. You can also transform logs from different sources into standardized formats that contains relevant, source-specific information.

After you have created a transformer, CloudWatch Logs performs the transformations at the time of log ingestion. You can then refer to the transformed versions of the logs during operations such as querying with CloudWatch Logs Insights or creating metric filters or subscription filers.

You can also use a transformer to copy metadata from metadata keys into the log events themselves. This metadata can include log group name, log stream name, account ID and Region.

A transformer for a log group is a series of processors, where each processor applies one type of transformation to the log events ingested into this log group. The processors work one after another, in the order that you list them, like a pipeline. For more information about the available processors to use in a transformer, see Processors that you can use .

Having log events in standardized format enables visibility across your applications for your log analysis, reporting, and alarming needs. CloudWatch Logs provides transformation for common log types with out-of-the-box transformation templates for major AWS log sources such as VPC flow logs, Lambda, and Amazon RDS. You can use pre-built transformation templates or create custom transformation policies.

You can create transformers only for the log groups in the Standard log class.

You can also set up a transformer at the account level. For more information, see PutAccountPolicy . If there is both a log-group level transformer created with PutTransformer and an account-level transformer that could apply to the same log group, the log group uses only the log-group level transformer. It ignores the account-level transformer.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.logs.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnTransformerPropsMixin cfnTransformerPropsMixin = CfnTransformerPropsMixin.Builder.create(CfnTransformerMixinProps.builder()
         .logGroupIdentifier("logGroupIdentifier")
         .transformerConfig(List.of(ProcessorProperty.builder()
                 .addKeys(AddKeysProperty.builder()
                         .entries(List.of(AddKeyEntryProperty.builder()
                                 .key("key")
                                 .overwriteIfExists(false)
                                 .value("value")
                                 .build()))
                         .build())
                 .copyValue(CopyValueProperty.builder()
                         .entries(List.of(CopyValueEntryProperty.builder()
                                 .overwriteIfExists(false)
                                 .source("source")
                                 .target("target")
                                 .build()))
                         .build())
                 .csv(CsvProperty.builder()
                         .columns(List.of("columns"))
                         .delimiter("delimiter")
                         .quoteCharacter("quoteCharacter")
                         .source("source")
                         .build())
                 .dateTimeConverter(DateTimeConverterProperty.builder()
                         .locale("locale")
                         .matchPatterns(List.of("matchPatterns"))
                         .source("source")
                         .sourceTimezone("sourceTimezone")
                         .target("target")
                         .targetFormat("targetFormat")
                         .targetTimezone("targetTimezone")
                         .build())
                 .deleteKeys(DeleteKeysProperty.builder()
                         .withKeys(List.of("withKeys"))
                         .build())
                 .grok(GrokProperty.builder()
                         .match("match")
                         .source("source")
                         .build())
                 .listToMap(ListToMapProperty.builder()
                         .flatten(false)
                         .flattenedElement("flattenedElement")
                         .key("key")
                         .source("source")
                         .target("target")
                         .valueKey("valueKey")
                         .build())
                 .lowerCaseString(LowerCaseStringProperty.builder()
                         .withKeys(List.of("withKeys"))
                         .build())
                 .moveKeys(MoveKeysProperty.builder()
                         .entries(List.of(MoveKeyEntryProperty.builder()
                                 .overwriteIfExists(false)
                                 .source("source")
                                 .target("target")
                                 .build()))
                         .build())
                 .parseCloudfront(ParseCloudfrontProperty.builder()
                         .source("source")
                         .build())
                 .parseJson(ParseJSONProperty.builder()
                         .destination("destination")
                         .source("source")
                         .build())
                 .parseKeyValue(ParseKeyValueProperty.builder()
                         .destination("destination")
                         .fieldDelimiter("fieldDelimiter")
                         .keyPrefix("keyPrefix")
                         .keyValueDelimiter("keyValueDelimiter")
                         .nonMatchValue("nonMatchValue")
                         .overwriteIfExists(false)
                         .source("source")
                         .build())
                 .parsePostgres(ParsePostgresProperty.builder()
                         .source("source")
                         .build())
                 .parseRoute53(ParseRoute53Property.builder()
                         .source("source")
                         .build())
                 .parseToOcsf(ParseToOCSFProperty.builder()
                         .eventSource("eventSource")
                         .mappingVersion("mappingVersion")
                         .ocsfVersion("ocsfVersion")
                         .source("source")
                         .build())
                 .parseVpc(ParseVPCProperty.builder()
                         .source("source")
                         .build())
                 .parseWaf(ParseWAFProperty.builder()
                         .source("source")
                         .build())
                 .renameKeys(RenameKeysProperty.builder()
                         .entries(List.of(RenameKeyEntryProperty.builder()
                                 .key("key")
                                 .overwriteIfExists(false)
                                 .renameTo("renameTo")
                                 .build()))
                         .build())
                 .splitString(SplitStringProperty.builder()
                         .entries(List.of(SplitStringEntryProperty.builder()
                                 .delimiter("delimiter")
                                 .source("source")
                                 .build()))
                         .build())
                 .substituteString(SubstituteStringProperty.builder()
                         .entries(List.of(SubstituteStringEntryProperty.builder()
                                 .from("from")
                                 .source("source")
                                 .to("to")
                                 .build()))
                         .build())
                 .trimString(TrimStringProperty.builder()
                         .withKeys(List.of("withKeys"))
                         .build())
                 .typeConverter(TypeConverterProperty.builder()
                         .entries(List.of(TypeConverterEntryProperty.builder()
                                 .key("key")
                                 .type("type")
                                 .build()))
                         .build())
                 .upperCaseString(UpperCaseStringProperty.builder()
                         .withKeys(List.of("withKeys"))
                         .build())
                 .build()))
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnTransformerPropsMixin

      protected CfnTransformerPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnTransformerPropsMixin

      protected CfnTransformerPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnTransformerPropsMixin

      @Stability(Stable) public CfnTransformerPropsMixin(@NotNull CfnTransformerMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::Logs::Transformer.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnTransformerPropsMixin

      @Stability(Stable) public CfnTransformerPropsMixin(@NotNull CfnTransformerMixinProps props)
      Create a mixin to apply properties to AWS::Logs::Transformer.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnTransformerMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()