Visualize the last value

Hi.

I'm trying to make a visualitzacion of an scripted field. The value of the scripted field only can be 1 or 0 is like a boolean. I want to visualice a line graph. I have two questions about that.

  • It its possible to make a visualitzación of the last element witout agregation ? I don't wanto to make average, sum or other agregation, i only want to show the value.

  • It is possible to visualize the same value until another value arrives ? For example, at 9:00 it takes me a 1, and at 12:00 a 0. I want the 1 to stay until a 0 arrives, representing for example that a parking spot is occupied. Now I'm using top hit, but I think that could be another better option.

Thank you so much.

Hi, which version of Kibana are you using? You can easily plot the last value with Lens. Go to Lens > Metric > Last Value > <your_field>.

If you want to stick to Metric visualization, you can do it by:

Metric Aggregation: Top Hit
Field: your_field
Aggregate with: concatenate
Size: 1
Sort on: @timestamp
Order: Descending

This should give you the last value.

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