Nov 16 2018
11:09 AM
- last edited on
Apr 07 2022
05:32 PM
by
TechCommunityAP
Nov 16 2018
11:09 AM
- last edited on
Apr 07 2022
05:32 PM
by
TechCommunityAP
I'm trying to write a query that will return results where the TimeGenerated value is greater than the date of the last Friday (for example). Is there a way to do this in KQL? Thanks!
Nov 18 2018 01:35 AM
Hi Mike,
As far as I know, you can get the "day of week" for a specific date, but not the other way around (date of a specific day in the week). Here's an example:
print(dayofweek(datetime(2018-10-29)))
The result is the number of days since Sunday. In the example above, the result is 1 which means Monday. You can read more about this function here and review the language reference for alternatives, if you prefer.
HTH,
Noa