CSV processor
Extracts fields from CSV line out of a single text field within a document. Any empty field in CSV will be skipped.
Table 9. CSV Options
| Name | Required | Default | Description |
|---|---|---|---|
| yes | - | The field to extract data from |
| yes | - | The array of fields to assign extracted values to |
| no | , | Separator used in CSV, has to be single character string |
| no | " | Quote used in CSV, has to be single character string |
| no |
| If |
| no |
| Trim whitespaces in unquoted fields |
| no | - | Value used to fill empty fields, empty fields will be skipped if this is not provided. Empty field is one with no value (2 consecutive separators) or empty quotes ( |
| no | - | Description of the processor. Useful for describing the purpose of the processor or its configuration. |
| no | - | Conditionally execute the processor. See Conditionally run a processor. |
| no |
| Ignore failures for the processor. See Handling pipeline failures. |
| no | - | Handle failures for the processor. See Handling pipeline failures. |
| no | - | Identifier for the processor. Useful for debugging and metrics. |
{
"csv": {
"field": "my_field",
"target_fields": ["field1", "field2"]
}
} If the trim option is enabled then any whitespace in the beginning and in the end of each unquoted field will be trimmed. For example with configuration above, a value of A, B will result in field field2 having value {nbsp}B (with space at the beginning). If trim is enabled A, B will result in field field2 having value B (no whitespace). Quoted fields will be left untouched.
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/csv-processor.html