Hey, so the below eval will run against the current time, then extract the current month and label it as currentmonth:
| eval currentmonth=relative_time(now(), "@mon")
For example "currentmonth" returns this value today: 1522562400.000000
Put that into a website like this : https://www.epochconverter.com/
Then you have a epoch time that Splunk created for the begining of the month: GMT: Sunday, April 1, 2018 6:00:00 AM
Then the @mon part of the search, extracts specifically the month from the currently time.
You could easily tweak this to do the same to which ever field is generating your date and time.
| eval new_date=strftime(strptime(<yourfield>, "%Y-%m-%d %H:%M:%S"),"%m")
## This will convert your field into epoch time. Then you could use something like below to tell your search which month you are looking for.
| eval end=relative_time(now(), "@mon") | eval start=relative_time(now(),"-1mon@mon")
| where new_date <= end AND new_date >= start AND _time <= end AND _time >= start |
... View more