alt textIf I use this, no event return
sourcetype=abc source="*"+strftime(now(),"%Y%m%d")+"*"
But when I modify the query to
sourcetype=abc source="*20141104*"
There is a events return.
May I know is that a bug in Splunk?
Here is what you are looking for
sourcetype=abc [|stats count | eval source = "*"+strftime(now(),"%Y%m%d")+"*" | fields source | format]
Edited Answer to show the better performance solution found by davebrooking, but optimized a little by me.
I just tried out your solution and it works, if eval-based definition is checked.
So thank you.
you're welcome 😉
looking at this picture, it's absolutely clear why your first search is the fastest: using any fields like index or source in the base search will speed up the search. Using a sub search will basically double search times but also speeds up the base search because you can use source in it and mine example simply does not provide any source field in the base search.