|
@@ -489,9 +489,10 @@ PUT _ingest/pipeline/my-pipeline
|
|
|
----
|
|
|
|
|
|
[[template-snippets]]
|
|
|
-To access field values, enclose the field name in double curly brackets `{{ }}`
|
|
|
-to create a https://mustache.github.io[Mustache] template snippet. You can use
|
|
|
-template snippets to dynamically set field names.
|
|
|
+Several processor parameters support https://mustache.github.io[Mustache]
|
|
|
+template snippets. To access field values in a template snippet, enclose the
|
|
|
+field name in triple curly brackets:`{{{field-name}}}`. You can use template
|
|
|
+snippets to dynamically set field names.
|
|
|
|
|
|
[source,console]
|
|
|
----
|
|
@@ -501,8 +502,8 @@ PUT _ingest/pipeline/my-pipeline
|
|
|
{
|
|
|
"set": {
|
|
|
"description": "Set dynamic '<service>' field to 'code' value",
|
|
|
- "field": "{{service}}",
|
|
|
- "value": "{{code}}"
|
|
|
+ "field": "{{{service}}}",
|
|
|
+ "value": "{{{code}}}"
|
|
|
}
|
|
|
}
|
|
|
]
|
|
@@ -528,7 +529,7 @@ PUT _ingest/pipeline/my-pipeline
|
|
|
"set": {
|
|
|
"description": "Set '_routing' to 'geoip.country_iso_code' value",
|
|
|
"field": "_routing",
|
|
|
- "value": "{{geoip.country_iso_code}}"
|
|
|
+ "value": "{{{geoip.country_iso_code}}}"
|
|
|
}
|
|
|
}
|
|
|
]
|
|
@@ -536,10 +537,10 @@ PUT _ingest/pipeline/my-pipeline
|
|
|
----
|
|
|
|
|
|
Use a Mustache template snippet to access metadata field values. For example,
|
|
|
-`{{_routing}}` retrieves a document's routing value.
|
|
|
+`{{{_routing}}}` retrieves a document's routing value.
|
|
|
|
|
|
WARNING: If you <<create-document-ids-automatically,automatically generate>>
|
|
|
-document IDs, you cannot use `{{_id}}` in a processor. {es} assigns
|
|
|
+document IDs, you cannot use `{{{_id}}}` in a processor. {es} assigns
|
|
|
auto-generated `_id` values after ingest.
|
|
|
|
|
|
[discrete]
|
|
@@ -566,7 +567,7 @@ PUT _ingest/pipeline/my-pipeline
|
|
|
"set": {
|
|
|
"description": "Index the ingest timestamp as 'event.ingested'",
|
|
|
"field": "event.ingested",
|
|
|
- "value": "{{_ingest.timestamp}}"
|
|
|
+ "value": "{{{_ingest.timestamp}}}"
|
|
|
}
|
|
|
}
|
|
|
]
|
|
@@ -683,7 +684,7 @@ PUT _ingest/pipeline/my-pipeline
|
|
|
"set": {
|
|
|
"description": "Index document to 'failed-<index>'",
|
|
|
"field": "_index",
|
|
|
- "value": "failed-{{ _index }}"
|
|
|
+ "value": "failed-{{{ _index }}}"
|
|
|
}
|
|
|
}
|
|
|
]
|