I want to combine several fields in Kibana's scripted fields editor using painless. I've got the following, but the field displays in Kibana's Discover interface with the literal \n rather than with a new line:
doc['field1'].value + '\\n' + doc['field2'].value
Secondary question: how do I check if doc['somefield'].value has a value before i include it?
You could use the elvis operator to do something only if the value is provided.
I do not think you can display scripted field results with newlines. In kibana, scripted field results are rendered as text strings so newlines or html will just be displayed as raw text without any formatting applied.
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.