Filtering on date = max_date

Short version: How do I create a "saved search" that filters based on the most recent date available?

Long version: I have a daily PIG job that updates ES based on the today's date. The problem is that sometimes the job fails and no data is updated for several days. So I want Kibana to filter based only on the data with the latest date, regardless of whether it's from today or a week ago. Is it possible and if so, how?

From what I've read here, I can retrieve the max "date" value with something like this: { "aggs" : { "max_date" : { "max" : { "field" : "date" } } } }. However, I'm not sure how to assign the max_date value to my filter.


You can't use aggregations in the filter search bar. To my knowledge, there is currently no way to dynamically change the time picker range based on the data.

Please feel free to submit an enhancement request (and contribute a PR!), if this is important to you: