JSON Input scripts


(David Reagan) #1

First:
According to the docs the default settings for scripting on an elasticsearch node are:

script.inline: sandbox
script.indexed: sandbox
script.file: true

That means that I don't have to reconfigure my ES node in order to use the JSON Input field, correct?

If that is true, how do I actually use that field? From these docs something like { "script" : "count * 100" } should cause the value of a metric visualization to add a couple zeros on the end.

In my tests, that does not happen.

What am I missing?

As for what my end goal is: I want to get the time between the last two log entries timestamps. Then show "OK" if it is less than some value, and "BAD" if it is greater than some value. Any tips on how to get that? Does it need scripting?


(Shelby Sturgis) #2

For your first question, as far as the script goes, you need to specify the field you want to manipulate. For example: { "script": doc['fieldname'].value * 100 }.

I am not sure how to solve your second question.


(system) #3