Hi,
My setup : Elasticsearch & Kibana - v6.4.3
I have data with following fields with following format @timestamp - date
device_no - string
device_type - string
consumption - float
Now i need to find out in a given time interval how many unique device_no have sum of consumption = "0"(Since there are readings which may be negative)
Is there any way i could use a metric visualization to set a filter within advanced json or on the search bar to enable me to get count of unique devices with "sum(cons) == 0" for that period
It sounds like the question you are trying to answer is: What is the unique count of buckets matching a specific value?
Assuming I understood your question correctly, this would probably be a use case for bucket selector aggregations.
Unfortunately, these are not yet supported in Kibana, although you can follow along with the relevant Github issues here and here to be notified of any updates.
In the meantime, the closest thing I can think of would be to set up a table visualization, and do a terms aggregation on device_no with a filter of consumption == 0. Assuming you set the aggregation size to a reasonable hypothetical limit, it will show you all of the matching buckets. Then if you toggle on the show total option and set it to count, it will at least give you the count you are looking for at the bottom of the table.
That said, this isn't a great alternative: it can be very inefficient if you have a large count of device_no, and it still doesn't capture the single metric you were looking for. But it's the closest thing that comes to mind without having bucket selector aggs available in Kibana today.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.