Hi,
I have a Splunk query as below which does a comparison between this week's hosts and last week's hosts
index="summary" search_name="query_1" earliest=-1w@w latest=now
| bucket span=1w _time
| stats values(_time) as weeks by my_hostname
| eval remark=case(mvcount(weeks)=2,"Present in both weeks", weeks=relative_time(now(),"@w"),"Present this week but not last week", true(),"Present last week but not this week") | search remark="Present this week but not last week" | stats count
Right now, I can only do the comparison between current week's hosts and last week's hosts
Now, how do I change the earliest and latest times in my query to compare the last week's hosts to before last week hosts and so on?
... View more