Visualize: JSON Input: how to use?

Hi,

I am on kibana 5.1.2.
I have some a field, which shows bytes, but I would like to convert it in an aggregation to MB.

I found out how to do it with scripted fields, but now my question is, can I do this with JSON Input too?

What do I need to enter in the json part, if I want to calculate value/1024/1024 ?
Do I need to enable scripting in elasticsearch? How?

thanks, Andreas

Try this in the JSON input field:

{
  "script": {
    "inline": "doc['system.memory.used.bytes'].value / 1024 / 1024",
    "lang": "painless"
  }
}
6 Likes

great, it works. Thanks a lot.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.