@3no
Example using 'tstats' but it works with normal search also.
The goal is to count number of events per hour between now and yesterday but display yesterday results as an overlay of todays' (you can change the time period if you want).
'addinfo' gets Search infos as result fields. I get "latest" value with it (info_max_time).
'eval' modifies "_time" when "date_wday" doesn't match "info_max_time" weekday.
The modification is about settings all "_time" on a "one day" time period (info_max_time day).
If my explanation doesn't make sens please don't hesitate to tell me, I'll try to rephrase.
| tstats count WHERE host=127.0.0.1 earliest=-1d latest=now BY _time, date_wday span=1h
| addinfo
| eval _time=if(match(date_wday, lower(strftime(info_max_time, "%A"))), _time, relative_time(info_max_time, "@d")+(_time-relative_time(_time, "@d")))
| timechart max(count) by date_wday fixedrange=f
Cheers,
... View more