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.
Thanks!
Alvaro