Search code examples
kibanametricbeat

Kibana : How to get Line graph to get percent usage?


I'm newbie with Kibana and I tried to get a line graph with CPU ressource (system or user) but values are in number type (between 0 and 1).

I want to multiply by 100 with a scripted field (painless language) but when I did :

return doc['system.memory.used.pct'].value.multiply(100)

or

return 100 * doc['system.memory.used.pct'].value

Values are completly wrong (for exemple 0.964 becomes 2.536, instead of 96.4)

Did I miss something ?

Here the screenshot of my visualization :

enter image description here


Solution

  • I'm slightly surprised that this doesn't work out of the box. If the values are really in percent (and the field ends in .pct), I think this should just work out of the box. See my example below:

    enter image description here

    Update:

    And here is the same visualization you're using. I only have a single host, but this is just working out of the box:

    enter image description here

    This is the underlying data in Discover:

    enter image description here

    And here is the index pattern:

    enter image description here

    I'd especially make sure that the index pattern is the same — both data type and format.