Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2arunpmohan/2fe2bec03cede863439917d7262494f6 to your computer and use it in GitHub Desktop.
Save 2arunpmohan/2fe2bec03cede863439917d7262494f6 to your computer and use it in GitHub Desktop.
Kibana JSON input values usage

Kibana Script usage

How to show the data on Y-axis in percentage

Use case example.

What we want to achieve?
Suppose we want to show the usage statistics of a process in Kibana.
The Y axis -  being the usage of the RAM
and the x-axis - the date/time

The issue
The issue here is that, the if the field selected for Y axis is showing in bytes (which most probabily is the case), we can see that the values are 100,000,000 etc. 
This makes the readability of the graphs an issue. Especially where we have more than 10Gb of RAM. 12GB usage and 1.2GB usage would be almost identical in the Yaxis and we will not be able to tell if the range of utilisation is in 12GB or is in 1.2GB.

Solution

We have an option in Kibana named as the JSON input fields. Here we can apply the scripts, so that we can modify the data shown in more human readable format.

Example of one such input here

{
  "script": {
    "inline": "doc['system.process.cgroup.memory.mem.usage.bytes'].value / 1024 / 1024/1024",
    "lang": "painless"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment