I'm trying to use scripted fields on my index pattern in Kibana 6.7. I basically want to have 'field_A' referenced in the URL template, and 'field_B' referenced in the Label Template, but I must be doing something wrong because I can't get it to work.
Is this possible, and if so, how do I need to format the script?
I've read the docs and they don't really cover this, but I found another forum post that made it sound like it's possible..
Does anyone know if what I'm trying to accomplish is possible? I've read the painless documentation and none of it seems to cover what I consider to be a somewhat trivial use-case..
Hi @seth.yes, unfortunately scripted fields and field formatters don't work in the way you're trying to use them. Your script can only return a single value. Since your script doesn't have an explicit return value I'm guessing it returns the value of the last line. In the URL template and Label template you can reference that single value with {{value}}. The word value is just a convention, it does not match the variable names you use in your script. The script is actually executed in Elasticsearch, whereas the URL formatter is executed in your browser, so the two know nothing about one another. The URL formatter is not limited to scripted fields, it can be used with regular fields as well.
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.