Hi there, thank you for posting your question. The way the Advanced JSON input works is that it allows you to customize the request sent to Elasticsearch by adding parameters to the aggregation configuration. The script parameter defines an inline script, which operates against each document, and not the result of the aggregation. So you can't use it to accomplish what you're trying to do.
Are you simply trying to "resize" your visualization? If I can get a better idea of the problem you're trying to solve I can try to suggest an alternate solution.
Thank you for your answer, let me explain.
I need to create a third column on my data table which should be the result of applying a script on my second column.
First column: driver_id Second column: group by driver_id (display doc_count) Third colum: apply a script with the second column as a parameter.
In the abode post I wanted to only divide the doc_count by 2, but I may need to apply a more complicated scripts.
I see! Well, as I mentioned you can write a Painless script to perform changes to the values in your documents which will affect the end result of the aggregation. Here's an example of what I mean:
Here, I've defined a script which divides the "bytes" field value by 2 before it's aggregated. You can see the result in the 3rd column of the data table. Does this help? It's tough to give a more precise suggestion without knowing exactly the kind of script you need, but hopefully this provides a starting point.
Hi Sarra, that's correct, that's not yet possible. I think this issue is relevant to what you're asking for, so you can subscribe to it if you would like to track progress on such a feature.
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.