I am storing JMS queue stats into ElasticSearch every minute. Each document contains "QueueName", "PendingMessageCount","EnqueuedMessageCount" and couple more stats fields. At the end of the day I wanted to be able to see in Kibana dashboard those stats, but I only wanted to see the most recent stats group by "Queue Name", and these info should not be affected by any Time Picker selection.
I went through all the visualization but found that none is suitable. I then decided to do with Saved Search. I created a search and add it to the Dashboard. I then went to edit the search object, have the following in kibanaSavedObjectMeta.searchSourceJSON:
If you click this arrow, a spy panel will open. Click on the Request tab of the spy panel. This will show the actual request that is being sent to Elasticsearch. Can you copy/paste that here please? Thanks!
Okay, so I don't think it is possible to override the aggs portion of the kibanaSavedObjectMeta.searchSourceJSON and have Discover use it. As you can see in the request Kibana actually sends to Elasticsearch, Discover adds its own aggs.
I think what you want may be covered in this issue - https://github.com/elastic/kibana/issues/6877 - but it might help me understand your use case better if you could provide a few example documents and the output you want to see from Kibana.
Shaunak - thanks for the info and quick turnaround on my question.
Please see below sample data that I will be indexing to ElasticSearch:
And at Kibana, when I load my dashboard, regardless of the time picker (and if possible, disregard the search criterion as well), I will be seeing only the following:
To add on, I still want to keep all the past data for histogram visualization.
Thanks for the examples; they helped me understand what you are going after here. It confirms what I thought earlier: you need the top_hits aggregation in Kibana to make this happen. Work for that is underway and you can follow its progress by subscribing to this issue: https://github.com/elastic/kibana/issues/6877 (same as the one in my previous comment).
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.