# Using AND when searching logs

**URL:** <https://community.auth0.com/t/using-and-when-searching-logs/60745>\
**Category:** Get Help\
**Created:** [April 8, 2021, 1:09am UTC](https://community.auth0.com/t/using-and-when-searching-logs/60745 "2021-04-08T01:09:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aferrer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aferrer/32/28655_2.png) [@aferrer](https://community.auth0.com/u/aferrer)\
**Post date:** [April 8, 2021, 1:09am UTC](https://community.auth0.com/t/using-and-when-searching-logs/60745/1 "2021-04-08T01:09:09Z")

</div>

I am trying to use the api/v2/logs endpoint to get a set of log entries. When I invoke **https://[domain]/api/v2/logs?q=type:sepft**, I can filter the results so that only events with the type “sepft” (successful exchange of password for token) show up in the search.

But now I want to also filter by date. And when I try “https://[domain]/api/v2/logs?q=type:sepft AND date:[\* TO 2021-04-08]” it is considered a bad request with the error message “The query ‘type:sepft AND date:[\* TO 2021-04-08]’ cannot be parsed.”

The documentation ([https://auth0.com/docs/logs/log-search-query-syntax](https://auth0.com/docs/logs/log-search-query-syntax)) says that AND, OR, and NOT operators are supported, but does not give any examples of their use.

What is the proper way to use AND when searching the logs?

Thank you.

---

<div class="post-metadata">

**Author:** ![ricardo.batista](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ricardo.batista/32/7711_2.png) [@ricardo.batista](https://community.auth0.com/u/ricardo.batista)\
**Post date:** [April 8, 2021, 6:50am UTC](https://community.auth0.com/t/using-and-when-searching-logs/60745/2 "2021-04-08T06:50:39Z")

</div>

Hi @aferrer

Thanks for reporting this. The issue doesn’t seem to be with the AND identifier since I can successfully get logs for:

`https://[domain]/api/v2/logs?q=type:sepft AND date:[2021-04-01 TO 2021-04-08]`

The failed parsing error appears only when you use the wildcard in the min range of the date, such as [\* TO 2021-04-08]. I’ve reported this to the engineering team, but in the meantime, you can just set a min date as anywhere before your [log retention date](https://auth0.com/docs/logs/log-data-retention).

---

<div class="post-metadata">

**Author:** ![aferrer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aferrer/32/28655_2.png) [@aferrer](https://community.auth0.com/u/aferrer)\
**Post date:** [April 8, 2021, 1:46pm UTC](https://community.auth0.com/t/using-and-when-searching-logs/60745/3 "2021-04-08T13:46:58Z")

</div>

Thanks, that was really helpful. I’ll avoid using the wildcards in the date for now.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 23, 2021, 1:47pm UTC](https://community.auth0.com/t/using-and-when-searching-logs/60745/4 "2021-04-23T13:47:02Z")

</div>

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