Kibana 5 alpha 4 script in JSON Input

(Ilia Katz) #1

I am trying to add a groovy script for a bucket in the Advanced section in JSON Input when creating a visualization. It works perfectly well in Kibana 4 but it doesn't work in Kibana 5 alpha 4. Needless to say thay I enabled groovy in the elasticsearch.yml.

{"script" : "doc['iteration_duration'].value", "lang": "groovy"}

I am getting the following error

Visualize: [parsing_exception] Unexpected token VALUE_STRING [script] in [24]., with { line=1 col=754 }

The above works well in Kibana 4. Any suggestions?

(Shaunak Kashyap) #2

Hi @mrvincnezo,

The syntax for specifying scripts in the aggregation DSL has become stricter in 5.0. Instead of:

{"script" : "doc['iteration_duration'].value", "lang": "groovy"}

Try this:

{ "script": { "inline": "doc['bytes'].value", "lang": "groovy" } }

Server returned HTTP response code: 400 for URL, when sending a post request to elasticsearch?
(Ilia Katz) #3

Thanks @shaunak. That worked perfectly.

(Rajesh Jai) #4

Thanks, it's working !


shaunak: your solution works. How come I still see the error message even though the chart shows up? Thanks.

(system) #6