# Problem "filter on maximum of timestamp"

**URL:** <https://discuss.elastic.co/t/problem-filter-on-maximum-of-timestamp/335518>\
**Category:** Kibana\
**Created:** [June 8, 2023, 8:34am UTC](https://discuss.elastic.co/t/problem-filter-on-maximum-of-timestamp/335518 "2023-06-08T08:34:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elteraxya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elteraxya/32/116434_2.png) [@elteraxya](https://discuss.elastic.co/u/elteraxya)\
**Post date:** [June 8, 2023, 8:34am UTC](https://discuss.elastic.co/t/problem-filter-on-maximum-of-timestamp/335518/1 "2023-06-08T08:34:39Z")

</div>

Hello everyone,  
I'd like to tell you about my problem. I have data coming up every day with logstash on my kibana, this data comes up either "ok" or "other" in a "status" field with the @timestamp of the day. I'd like to sort the "name" field to display only the rows that haven't had a "status = OK" for more than 3 days.  
I've tried this little line of code "@timestamp \<= now-3d" added to a sort on the maximum of @timestamp for which "status = others" but this has the effect of returning the lines 3 days before today without taking into account that it's only those containing "status = others" for 3 days that I'm interested in. Among other things, a sort that verifies that there has been no "status = ok" for 3 days from now would work just as well.

Thank you very much.

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [June 8, 2023, 9:20am UTC](https://discuss.elastic.co/t/problem-filter-on-maximum-of-timestamp/335518/2 "2023-06-08T09:20:43Z")

</div>

i think best way to achieve this is to just select the correct time range in time picker.

but lets look into your query:L `@timestamp <= now-3d` means that timestamp must be smaller or equal to 3 days ago. what you actually want to tell it that timestamp needs to be larger than 3 days ago: `@timestamp >= now-3d`

---

<div class="post-metadata">

**Author:** ![elteraxya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elteraxya/32/116434_2.png) [@elteraxya](https://discuss.elastic.co/u/elteraxya)\
**Post date:** [June 8, 2023, 9:37am UTC](https://discuss.elastic.co/t/problem-filter-on-maximum-of-timestamp/335518/3 "2023-06-08T09:37:45Z")

</div>

thank you for your reply and I see what you mean but in reality the field I'm most interested in is not the timestamp but the status over the last 3 days to check if this "account" is problematic because it's been "down" for more than 3 days.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2023, 9:38am UTC](https://discuss.elastic.co/t/problem-filter-on-maximum-of-timestamp/335518/4 "2023-07-06T09:38:02Z")

</div>

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