I have configured my application logs over splunk and want to do the following -
- Get events when the string has today's date
- Get events when the string has tomorrow's date.
I have tried to write a query as below for #1, but it doesn't seem to return anything
REGAVAIL | eval Date=strftime(strptime(Date, "%m%d%Y"), "%m%d%Y") | where Date>= strftime(now(), "%m%d%Y")
My search string is REGAVAIL and all events are in the below format -
REGAVAIL|00958645030|8871|1|61745|01262017|0|N|N|Y|N|Y|N|N|O|O|O|O|O|O|O|1013|F REGAVAIL|00958647200|8871|1|61745|01282017|0|N|N|Y|N|Y|N|N|O|O|O|O|O|O|O|1013|F REGAVAIL|00958649200|8871|1|61745|01292017|0|N|N|Y|N|Y|N|N|O|O|O|O|O|O|O|1013|F
I want to first extract date from it - 01262017and then compare it with today's date. If the match is found, that event should be considered.
Any help would be appreciated!