# How to get two different timefilters for two date-fields

**URL:** <https://discuss.elastic.co/t/how-to-get-two-different-timefilters-for-two-date-fields/279603>\
**Category:** Kibana\
**Created:** [July 26, 2021, 8:20am UTC](https://discuss.elastic.co/t/how-to-get-two-different-timefilters-for-two-date-fields/279603 "2021-07-26T08:20:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![basti1798](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@basti1798](https://discuss.elastic.co/u/basti1798)\
**Post date:** [July 26, 2021, 8:20am UTC](https://discuss.elastic.co/t/how-to-get-two-different-timefilters-for-two-date-fields/279603/1 "2021-07-26T08:20:25Z")

</div>

Hi all,

for my project I have to use all data in kibana, which has a timestamp of the last week, which is not the problem.  
But there is another date field called lastSeen which is independent to the timestamp and this date have to be in the last month.

So have anyone an idea how I can filter data in that way that one date field is not older than a week and the other one is not older than a month?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [July 26, 2021, 9:59pm UTC](https://discuss.elastic.co/t/how-to-get-two-different-timefilters-for-two-date-fields/279603/2 "2021-07-26T21:59:44Z")

</div>

Hello,

You could use the [Kibana Time Filter](https://www.elastic.co/guide/en/kibana/current/set-time-filter.html) to narrow results by the index pattern's default date field and then enter a [KQL query in the query bar](https://www.elastic.co/guide/en/kibana/7.x/advanced-queries.html) to filter by the other attribute.

Alternatively you could just by pass the Time Filter altogether and enter both criteria in the query bar. From what you're describing, you'd just apply them both using an `and` between the two filter queries.

Hope that helps!

Regards,  
Aaron

---

<div class="post-metadata">

**Author:** ![basti1798](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@basti1798](https://discuss.elastic.co/u/basti1798)\
**Post date:** [July 27, 2021, 1:30pm UTC](https://discuss.elastic.co/t/how-to-get-two-different-timefilters-for-two-date-fields/279603/3 "2021-07-27T13:30:32Z")

</div>

Thanks for the fast answer.

That is a possible way to solve the Problem but in KQL I can use specific dates like "2021-07-27...". Because I need the date monthly it would be better if I could say "not older than a week" or "older than a month" or something like this.

Is there also a way to express this in KQL?

Again thanks in advance for your help.

---

<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:** [August 24, 2021, 1:31pm UTC](https://discuss.elastic.co/t/how-to-get-two-different-timefilters-for-two-date-fields/279603/4 "2021-08-24T13:31:08Z")

</div>

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