Class CfnTransformer
Creates or updates a log transformer for a single log group.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnTransformer : CfnResource, IInspectable
Syntax (vb)
Public Class CfnTransformer
Inherits CfnResource
Implements IInspectable
Remarks
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.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-transformer.html
CloudformationResource: AWS::Logs::Transformer
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Logs;
var cfnTransformer = new CfnTransformer(this, "MyCfnTransformer", new CfnTransformerProps {
LogGroupIdentifier = "logGroupIdentifier",
TransformerConfig = new [] { new ProcessorProperty {
AddKeys = new AddKeysProperty {
Entries = new [] { new AddKeyEntryProperty {
Key = "key",
Value = "value",
// the properties below are optional
OverwriteIfExists = false
} }
},
CopyValue = new CopyValueProperty {
Entries = new [] { new CopyValueEntryProperty {
Source = "source",
Target = "target",
// the properties below are optional
OverwriteIfExists = false
} }
},
Csv = new CsvProperty {
Columns = new [] { "columns" },
Delimiter = "delimiter",
QuoteCharacter = "quoteCharacter",
Source = "source"
},
DateTimeConverter = new DateTimeConverterProperty {
MatchPatterns = new [] { "matchPatterns" },
Source = "source",
Target = "target",
// the properties below are optional
Locale = "locale",
SourceTimezone = "sourceTimezone",
TargetFormat = "targetFormat",
TargetTimezone = "targetTimezone"
},
DeleteKeys = new DeleteKeysProperty {
WithKeys = new [] { "withKeys" }
},
Grok = new GrokProperty {
Match = "match",
// the properties below are optional
Source = "source"
},
ListToMap = new ListToMapProperty {
Key = "key",
Source = "source",
// the properties below are optional
Flatten = false,
FlattenedElement = "flattenedElement",
Target = "target",
ValueKey = "valueKey"
},
LowerCaseString = new LowerCaseStringProperty {
WithKeys = new [] { "withKeys" }
},
MoveKeys = new MoveKeysProperty {
Entries = new [] { new MoveKeyEntryProperty {
Source = "source",
Target = "target",
// the properties below are optional
OverwriteIfExists = false
} }
},
ParseCloudfront = new ParseCloudfrontProperty {
Source = "source"
},
ParseJson = new ParseJSONProperty {
Destination = "destination",
Source = "source"
},
ParseKeyValue = new ParseKeyValueProperty {
Destination = "destination",
FieldDelimiter = "fieldDelimiter",
KeyPrefix = "keyPrefix",
KeyValueDelimiter = "keyValueDelimiter",
NonMatchValue = "nonMatchValue",
OverwriteIfExists = false,
Source = "source"
},
ParsePostgres = new ParsePostgresProperty {
Source = "source"
},
ParseRoute53 = new ParseRoute53Property {
Source = "source"
},
ParseVpc = new ParseVPCProperty {
Source = "source"
},
ParseWaf = new ParseWAFProperty {
Source = "source"
},
RenameKeys = new RenameKeysProperty {
Entries = new [] { new RenameKeyEntryProperty {
Key = "key",
RenameTo = "renameTo",
// the properties below are optional
OverwriteIfExists = false
} }
},
SplitString = new SplitStringProperty {
Entries = new [] { new SplitStringEntryProperty {
Delimiter = "delimiter",
Source = "source"
} }
},
SubstituteString = new SubstituteStringProperty {
Entries = new [] { new SubstituteStringEntryProperty {
From = "from",
Source = "source",
To = "to"
} }
},
TrimString = new TrimStringProperty {
WithKeys = new [] { "withKeys" }
},
TypeConverter = new TypeConverterProperty {
Entries = new [] { new TypeConverterEntryProperty {
Key = "key",
Type = "type"
} }
},
UpperCaseString = new UpperCaseStringProperty {
WithKeys = new [] { "withKeys" }
}
} }
});
Synopsis
Constructors
Cfn |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Cfn |
Used by jsii to construct an instance of this class from DeputyProps |
Cfn |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
Cfn |
|
Log |
Specify either the name or ARN of the log group to create the transformer for. |
Transformer |
This structure is an array that contains the configuration of this log transformer. |
Methods
Inspect(Tree |
Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnTransformer(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnTransformer(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
CfnTransformer(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnTransformer(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
CfnTransformer(Construct, String, ICfnTransformerProps)
public CfnTransformer(Construct scope, string id, ICfnTransformerProps props)
Parameters
- scope Constructs.
Construct Scope in which this resource is defined.
- id System.
String Construct identifier for this resource (unique in its scope).
- props ICfn
Transformer Props Resource properties.
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.
Overrides
LogGroupIdentifier
Specify either the name or ARN of the log group to create the transformer for.
public virtual string LogGroupIdentifier { get; set; }
Property Value
System.
TransformerConfig
This structure is an array that contains the configuration of this log transformer.
public virtual object TransformerConfig { get; set; }
Property Value
System.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector Tree
Inspector tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.
Collections. <System.Generic. IDictionary String , System.Object >
Returns
System.