Skip to content
v2.275.0

ParseKeyValueProperty Struct ​

This processor parses a specified field in the original log event into key-value pairs.

For more information about this processor including examples, see parseKeyValue 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 parseKeyValueProperty: logs.ParseKeyValueProperty = {
  destination: 'destination',
  fieldDelimiter: logs.KeyValuePairDelimiter.AMPERSAND,
  keyPrefix: 'keyPrefix',
  keyValueDelimiter: logs.KeyValueDelimiter.EQUAL,
  nonMatchValue: 'nonMatchValue',
  overwriteIfExists: false,
  source: 'source',
};

Properties ​

destinationoptionalstringdestinationoptionalstrdestinationoptionalStringDestinationoptionalstringDestinationoptional*string#
The destination field to put the extracted key-value pairs into.

Default: Places at the root of the JSON input.

fieldDelimiteroptionalKeyValuePairDelimiterfield_delimiteroptionalKeyValuePairDelimiterfieldDelimiteroptionalKeyValuePairDelimiterFieldDelimiteroptionalKeyValuePairDelimiterFieldDelimiteroptionalKeyValuePairDelimiter= KeyValuePairDelimiter.AMPERSAND#
The field delimiter string that is used between key-value pairs in the original log events.
keyPrefixoptionalstringkey_prefixoptionalstrkeyPrefixoptionalStringKeyPrefixoptionalstringKeyPrefixoptional*string#
If you want to add a prefix to all transformed keys, specify it here.

Default: No prefix is added to the keys.

keyValueDelimiteroptionalKeyValueDelimiterkey_value_delimiteroptionalKeyValueDelimiterkeyValueDelimiteroptionalKeyValueDelimiterKeyValueDelimiteroptionalKeyValueDelimiterKeyValueDelimiteroptionalKeyValueDelimiter= KeyValueDelimiter.EQUAL#
The delimiter string to use between the key and value in each pair in the transformed log event.
nonMatchValueoptionalstringnon_match_valueoptionalstrnonMatchValueoptionalStringNonMatchValueoptionalstringNonMatchValueoptional*string#
A value to insert into the value field in the result, when a key-value pair is not successfully split.

Default: No values is inserted when split is not successful.

overwriteIfExistsoptionalbooleanoverwrite_if_existsoptionalbooloverwriteIfExistsoptionalBooleanOverwriteIfExistsoptionalboolOverwriteIfExistsoptional*bool= false#
Specifies whether to overwrite the value if the destination key already exists.
sourceoptionalstringsourceoptionalstrsourceoptionalStringSourceoptionalstringSourceoptional*string= '@message'#
Path to the field in the log event that will be parsed.

Use dot notation to access child fields.