Problem with "Last Value"

Hi,

for example:
i want to show the last value of my Data: State in a metric aggregation.

I receive the documents in Kibana like this:

Doc 1:
{
"timestamp": ...,
"state": 1
}

Doc2:
{
"timestamp": ...,
"room_temperature": 25
}

When Doc 1 is incoming my Metric aggregation is showing "1" ... so everything is perfect, but when the Doc2 is incoming, my "state" is set to "-".
So all variables, that are not included in the last incoming document are set to "-".

How can I achieve that my metric "saves" the last value of "state" until it gets a new value?

Thank you!

When using lens you can add a filter to last value like this: state: *. This will make sure the last document with a non-null value for state will be considered instead of the very last document.

Thanks,
yeah why didn't i think about that.

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