JSON processor
Converts a JSON string into a structured JSON object.
Table 30. Json Options
| Name | Required | Default | Description |
|---|---|---|---|
| yes | - | The field to be parsed. |
| no |
| The field that the converted structured object will be written into. Any existing content in this field will be overwritten. |
| no | false | Flag that forces the parsed JSON to be added at the top level of the document. |
| no |
| When set to |
| no | false | When set to |
| no | true | When set to |
| 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. |
All JSON-supported types will be parsed (null, boolean, number, array, object, string).
Suppose you provide this configuration of the json processor:
{
"json" : {
"field" : "string_source",
"target_field" : "json_target"
}
} If the following document is processed:
{
"string_source": "{\"foo\": 2000}"
} after the json processor operates on it, it will look like:
{
"string_source": "{\"foo\": 2000}",
"json_target": {
"foo": 2000
}
} If the following configuration is provided, omitting the optional target_field setting:
{
"json" : {
"field" : "source_and_target"
}
} then after the json processor operates on this document:
{
"source_and_target": "{\"foo\": 2000}"
} it will look like:
{
"source_and_target": {
"foo": 2000
}
} This illustrates that, unless it is explicitly named in the processor configuration, the target_field is the same field provided in the required field configuration.
© 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/8.17/json-processor.html