Show Max and Min value for given period

Hi All,

I'm measuring temperature with a sensor, send it to Logstash -> Elasticsearch. Currently everything is going well with temperature change visualizer, but I play a lot with all other available visualizers last 2 days and I have no idea how to create/config visualizer and to show at which date/hour was MAX temperature and on which date/hour was MIN temperature for given period, for example - 1 day, one week or one month. It doesn't matter what kind will be - table, bar-chart or whatever, I just want to have for example:

Period: 01.01.2020 00:00:00 - 01.02.2020 23:59:50
max temp: 23.4 at 10.01.2020 22:30:00
min temp: 19.2 at 22.01.2020 02:30:00

Thanks in advance

This should be doable using two metric visualizations (one for max, one for min) using the "top hit" agg to fetch the timestamp of the maximum temperature:

The second metric here is just showing the max of a field (that's the easy part) - the first metric is fetching the first document ordered by the same field (descending for max, for min you need to use ascending) showing the timestamp

Hi Joe,

Thanks for the advice, it work as charm :slight_smile:

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