Transforms API not admitting triple quotes

We are trying to create a transform using painless scripts for aggregations, such as explained here.

In Kibana's dev tools, we use Transforms Preview and it works wonderfully.

However, whenever we want to post the transform via API or through Kibana' transform creation interface, it seems that ES won't accept the triple quotes.

Any idea on what are we doing wrong?

Triple quotes are a formatting nicety of Kibana. When it posts to the elasticsearch API however it converts it into legal JSON without the triple quotes. You can see this if you open the "network" part of Chrome's developer tools to see what content is actually sent to elasticsearch.

Mark already answered regarding the API I will ask around regarding the UI, you mean the advanced editor, correct?.

Good news, the advanced editor glitch is a known issue and has already been fixed in 7.7:

Great, using single_quote + one_liner works. I will do this until we update to 7.7.
Thanks both!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.