Skip to content
v2.278.0

DateTimeConverterProperty Struct ​

This processor converts a datetime string into a format that you specify.

For more information about this processor including examples, see datetimeConverter in the CloudWatch Logs User Guide.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_logs as logs } from 'aws-cdk-lib';
const dateTimeConverterProperty: logs.DateTimeConverterProperty = {
  locale: 'locale',
  matchPatterns: ['matchPatterns'],
  source: 'source',
  target: 'target',

  // the properties below are optional
  sourceTimezone: 'sourceTimezone',
  targetFormat: 'targetFormat',
  targetTimezone: 'targetTimezone',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_logs as logs

date_time_converter_property = logs.DateTimeConverterProperty(
    locale="locale",
    match_patterns=["matchPatterns"],
    source="source",
    target="target",

    # the properties below are optional
    source_timezone="sourceTimezone",
    target_format="targetFormat",
    target_timezone="targetTimezone"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.logs.*;

DateTimeConverterProperty dateTimeConverterProperty = DateTimeConverterProperty.builder()
        .locale("locale")
        .matchPatterns(List.of("matchPatterns"))
        .source("source")
        .target("target")

        // the properties below are optional
        .sourceTimezone("sourceTimezone")
        .targetFormat("targetFormat")
        .targetTimezone("targetTimezone")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// 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 dateTimeConverterProperty = new DateTimeConverterProperty {
    Locale = "locale",
    MatchPatterns = new [] { "matchPatterns" },
    Source = "source",
    Target = "target",

    // the properties below are optional
    SourceTimezone = "sourceTimezone",
    TargetFormat = "targetFormat",
    TargetTimezone = "targetTimezone"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

dateTimeConverterProperty := &DateTimeConverterProperty{
	Locale: jsii.String("locale"),
	MatchPatterns: []*string{
		jsii.String("matchPatterns"),
	},
	Source: jsii.String("source"),
	Target: jsii.String("target"),

	// the properties below are optional
	SourceTimezone: jsii.String("sourceTimezone"),
	TargetFormat: jsii.String("targetFormat"),
	TargetTimezone: jsii.String("targetTimezone"),
}

Properties ​

localestringlocalestrlocaleStringLocalestringLocale*string required #
The locale of the source field.
matchPatternsstring[]match_patternstyping.List[str]matchPatternsList<String>MatchPatternsstring[]MatchPatterns*[]*string required #
A list of patterns to match against the source field.
sourcestringsourcestrsourceStringSourcestringSource*string required #
The key to apply the date conversion to.
sourceTimezoneoptionalstringsource_timezoneoptionalstrsourceTimezoneoptionalStringSourceTimezoneoptionalstringSourceTimezoneoptional*string = UTC #
The time zone of the source field.
targetstringtargetstrtargetStringTargetstringTarget*string required #
The JSON field to store the result in.
targetFormatoptionalstringtarget_formatoptionalstrtargetFormatoptionalStringTargetFormatoptionalstringTargetFormatoptional*string = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" #
The datetime format to use for the converted data in the target field.
targetTimezoneoptionalstringtarget_timezoneoptionalstrtargetTimezoneoptionalStringTargetTimezoneoptionalstringTargetTimezoneoptional*string = UTC #
The time zone of the target field.