Auth0 Home Blog Docs

Filter logs by date

logs
api-2
search

#1

I am using Enterprise Auth0 an I’m trying to get all the logs of the user filtered by date.

The API calls looks like:

https://some-url/api/v2/logs?fields=date,type,user_name&include_fields=true&include_totals=true&search=date:[2017-07-27 TO *]

But this does not do any filtering based on date.

Note: In my version of API, the search field of querystring is search and not q


#2

The example URL you provided is for Auth0 Management API v2, https://[account]/api/v2/..., however, you then use a search parameter instead of q and mention that your version of the API does not use q.

To my knowledge, the search parameter is only formally supported in v1 of the Management API, but if that’s what you’re trying to use (which is not recommended as it is deprecated) then you’re using an incorrect URL.

In conclusion, when calling the v2 endpoint you should use the q parameter.


#3

If we use a different filter in search like type:"s*", it works:

https://some-url/api/v2/logs?fields=date,type,user_name&include_fields=true&include_totals=true&search=type:“s*”

However it does not seem to return any log when used with date.


Search the logs at a specific date
#4

We are using enterprise addition of Auth0 where search is used instead of q for filtering the result.


#5

What do you mean with that; are you using PSaaS Appliance and not the public cloud, is that it?


#6

Yes, we are not using public cloud.
We have a separate instance of Auth0.


#7