Hi davdes44,
you cannot use a sub search inside an eval .
You can use this nice app https://apps.splunk.com/app/1645 which will handle such use cases or take a look at this run everywhere command, which will compare the event count of two days, one week ago and today:
index=_internal earliest=-1w@w sourcetype=splunkd date_wday=wednesday
| bucket _time span=1d
| stats last(_time) AS last_time count AS per_min_count by _time, host
| eval 1w_ago = if(last_time > exact(relative_time(now(),"-1w@w")) AND last_time <= exact(relative_time(now(),"-0w@w")) , per_min_count ,"0")
| eval current_count = if(last_time > exact(relative_time(now(),"-1d@d")) AND last_time <= exact(relative_time(now(),"-0d@d")) , per_min_count ,"0")
| stats max(last_time) AS _time, values(host) AS host, max(current_count) AS current_count, max(1w_ago) AS 1w_ago
| eval diff = '1w_ago' - 'current_count'
First we get all events for wednesday over the last two weeks, then setup _time buckets per day, do some time based eval magic and count the results, display the result using stats and use a final eval to calculate the difference for the two results.
Hope this helps to get you started ...
cheers, MuS
... View more