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.
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"
}
}