Class CfnTransformerPropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis object defines one key that will be added with the addKeys processor.static interfaceThis processor adds new key-value pairs to the log event.static final classA fluent builder forCfnTransformerPropsMixin.static interfaceThis object defines one value to be copied with the copyValue processor.static interfaceThis processor copies values within a log event.static interfaceTheCSVprocessor parses comma-separated values (CSV) from the log events into columns.static interfaceThis processor converts a datetime string into a format that you specify.static interfaceThis processor deletes entries from a log event.static interfaceThis processor uses pattern matching to parse and structure unstructured data.static interfaceThis processor takes a list of objects that contain key fields, and converts them into a map of target keys.static interfaceThis processor converts a string to lowercase.static interfaceThis object defines one key that will be moved with the moveKey processor.static interfaceThis processor moves a key from one field to another.static interfaceThis processor parses CloudFront vended logs, extract fields, and convert them into JSON format.static interfaceThis processor parses log events that are in JSON format.static interfaceThis processor parses a specified field in the original log event into key-value pairs.static interfaceUse this processor to parse RDS for PostgreSQL vended logs, extract fields, and and convert them into a JSON format.static interfaceUse this processor to parse Route 53 vended logs, extract fields, and and convert them into a JSON format.static interfaceThis processor converts logs into Open Cybersecurity Schema Framework (OCSF) events.static interfaceUse this processor to parse Amazon VPC vended logs, extract fields, and and convert them into a JSON format.static interfaceUse this processor to parse AWS WAF vended logs, extract fields, and and convert them into a JSON format.static interfaceThis structure contains the information about one processor in a log transformer.static interfaceThis object defines one key that will be renamed with the renameKey processor.static interfaceUse this processor to rename keys in a log event.static interfaceThis object defines one log field that will be split with the splitString processor.static interfaceUse this processor to split a field into an array of strings using a delimiting character.static interfaceThis object defines one log field key that will be replaced using the substituteString processor.static interfaceThis processor matches a key’s value against a regular expression and replaces all matches with a replacement string.static interfaceUse this processor to remove leading and trailing whitespace.static interfaceThis object defines one value type that will be converted using the typeConverter processor.static interfaceUse this processor to convert a value type associated with the specified key to the specified type.static interfaceThis processor converts a string field to uppercase.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::Logs::Transformer.CfnTransformerPropsMixin(CfnTransformerMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::Logs::Transformer.protectedCfnTransformerPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnTransformerPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnTransformerMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 toAWS::Logs::Transformer.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnTransformerPropsMixin
Create a mixin to apply properties toAWS::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. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-