We are building some environmental measures graphs on a ElasticSearch + Kibana dashboard using lens.
We have an index where values of certain contaminants, measured by several environmental stations, are stored.
Using those data, we've builded some lens graphs where we show the median of those values oposed to time, so you can see air quality evolution on the city. On some of those graphs we've used a moving average of median values, as european regulations states maximum levels of some contaminants on a 24h or 8h periods.
Everything is fine to this point. What we want to do now is to create new graphs where we count how many times certain values of those medians (or moving averages of medians) are reached, as regulations also state a limited amount of times per year those maximum values can be surpased.
The fact is... that we don't have any clue about how to do this. I think those graphs can not be done using lens, but are not very sure which other possible tools on kibana can be used to reach this target.
Any idea would be appreciated.
Since Kibana 8.6 that is possible with the Lens Formula ifelse
:
ifelse( moving_average( ... ) > THRESHOLD, 1, 0)
Sum
down in the panelFinal result: