ListToMapProperty

class aws_cdk.aws_logs.ListToMapProperty(*, key, source, flatten=None, flattened_element=None, target=None, value_key=None)

Bases: object

This processor takes a list of objects that contain key fields, and converts them into a map of target keys.

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

Parameters:
  • key (str) – The key of the field to be extracted as keys in the generated map.

  • source (str) – The key in the log event that has a list of objects that will be converted to a map.

  • flatten (Optional[bool]) – A Boolean value to indicate whether the list will be flattened into single items. Default: false

  • flattened_element (Optional[str]) – If you set flatten to true, use flattenedElement to specify which element, first or last, to keep. You must specify this parameter if flatten is true. Default: - Must be specified if flatten is true and if flatten is false, has no effect

  • target (Optional[str]) – The key of the field that will hold the generated map. Default: - Stored at the root of the log event

  • value_key (Optional[str]) – If this is specified, the values that you specify in this parameter will be extracted from the source objects and put into the values of the generated map. Default: - Original objects in the source list will be put into the values of the generated map

ExampleMetadata:

fixture=_generated

Example:

# 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

list_to_map_property = logs.ListToMapProperty(
    key="key",
    source="source",

    # the properties below are optional
    flatten=False,
    flattened_element="flattenedElement",
    target="target",
    value_key="valueKey"
)

Attributes

flatten

A Boolean value to indicate whether the list will be flattened into single items.

Default:

false

flattened_element

If you set flatten to true, use flattenedElement to specify which element, first or last, to keep.

You must specify this parameter if flatten is true.

Default:
  • Must be specified if flatten is true and if flatten is false, has no effect

key

The key of the field to be extracted as keys in the generated map.

source

The key in the log event that has a list of objects that will be converted to a map.

target

The key of the field that will hold the generated map.

Default:
  • Stored at the root of the log event

value_key

If this is specified, the values that you specify in this parameter will be extracted from the source objects and put into the values of the generated map.

Default:
  • Original objects in the source list will be put into the values of the generated map