Reputation: 11
Trying to filter Azure AD audit events by only querying date that was created in the last 24 hours:
Example: https://graph.microsoft.com/v1.0/auditLogs/signIns?$dateTime,-24
How would I accomplish this?
Upvotes: 1
Views: 1433
Reputation: 1
I was trying to do this in an Azure Logic App and had to 1) Create a parameter of "startTime" 2) create 2 variables for the startDateTime and endDateTime 3) then use them in the Graph API call.
Upvotes: 0
Reputation: 15754
We can just subtract 24 hours from the current time and set it as the query filter. For example, if the current time is 2020-04-09T07:00:00Z
, the time minus 24 hours is 2020-04-08T07:00:00Z
. Then we can use the filter in graph api:
https://graph.microsoft.com/v1.0/auditLogs/signIns?$filter=createdDateTime ge 2020-04-08T07:00:00Z
Upvotes: 1