i have to maintain pretty big search templates. Now, I'd like to extend them by adding conditional clauses, as described here, it should be possible with pre-registered templates. But I ran into the same issue.
Maybe someone knows, how to escape the following code in a "pretty-printed" template in Kibana without having to escape the whole query:
As written above, this template is not valid JSON because it includes the section markers like {{#line_no}} . For this reason, the template should either be stored in a file (see Pre-registered templateedit) or, when used via the REST API, should be written as a string
@dadoonet I made a comment in your pull request because I think there is still confusion.
It's now impossible to push invalid json templates into ES because the only way to do that was via files and this options is now gone.
So even the new wording is wrong and confusing.
There is now only 1 option when the template becomes invalid JSON because of mustache syntax and it is to put all of it in a string, escape it so it's valid and then push it via the API.
You can't push invalid JSON in the body of the POST to _scripts/* so when files went away, it left only 1 option.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.