sort -date | dedup Date_Month_Year | where Date>1575183600
I need this query to run only for the past 120 days from today. I can put in the date manually as above, but need this to be more automated so anyone can run this query and get results for the current to 120 day range.
I have the following fields:
Date Date_Friendly Date_Month_Year Host_Count
15786200 01/01/2020 January 2020 1234
I have tried 2 things and neither works.
where (strptime(Date, "%m/%d/%Y")>=strptime("4/2/2018", "%m/%d/%Y")) AND (strptime(Date, "%m/%d/%Y")>=strptime("4/10/2018", "%m/%d/%Y"))
| eval Date="1/1/2020"
| eval timestampDate=strptime(Date, "%m/%d/%Y")
| eval timestampStart=strptime("1/1/2020", "%m/%d/%Y")
| eval timestampEnd=strptime("5/1/2020", "%m/%d/%Y")
| eval formattedTimestamp = strftime(timestamp,"%Y-%m-%dT%H:%M:%S")
| where timestampDate >= timestampStart AND timestampDate <= timestampEnd
... View more