Scriptting in Json Input Problem


(Kennedy Kan) #1

I am trying topbeat with ES and Kibana 5.0 Alpha 4. When I display result in the visualization, for example, it didnt turn my figure from bytes to Gb as the past version. Here shows the example.

The disk space are all in bytes. What json input can I write to make it turn from bytes to Gb or is there other ways of doing it?


(Tyler Smalley) #2

You can use an inline script:

{
  "script" : {
    "inline" : "doc['fs.total'].value / 1024",
    "lang" : "painless"
  }
}

(Lee Drengenberg) #3

You can also create a scripted field like diskspaceKB and/or diskspaceMB in the settings tab. Select your index pattern, then go to the scripted fields tab. Then Add Scripted field button. There's some instructions on that page.


(system) #4