Extract array
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
Generally available
This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
The extract_array processor populates fields with values read from an array field.
The following example populates source.ip with the first element of the my_array field, destination.ip with the second element, and network.transport with the third.
- extract_array:
field: my_array
mappings:
source.ip: 0
destination.ip: 1
network.transport: 2
Elastic Agent processors execute before ingest pipelines, which means that your processor configurations cannot refer to fields that are created by ingest pipelines or Logstash. For more limitations, refer to What are some limitations of using processors?
| Name | Required | Default | Description |
|---|---|---|---|
field |
Yes | The array field whose elements are to be extracted. | |
mappings |
Yes | Maps each field name to an array index. Use 0 for the first element in the array. Multiple fields can be mapped to the same array element. | |
ignore_missing |
No | false |
Whether to ignore events where the array field is missing. If false, processing of an event fails if the specified field does not exist. |
overwrite_keys |
No | false |
Whether to overwrite target fields specified in the mapping if the fields already exist. If false, processing fails if a target field already exists. |
fail_on_error |
No | true |
If true and an error occurs, any changes to the event are reverted, and the original event is returned. If false, processing continues despite errors. |
omit_empty |
No | false |
Whether empty values are extracted from the array. If true, instead of the target field being set to an empty value, it is left unset. The empty string (""), an empty array ([]), or an empty object ({}) are considered empty values. |