In relation to this post:
https://answers.splunk.com/answers/209329/how-do-i-display-the-current-date-month-and-year-i.html
How would I display the PREVIOUS month on a dashboard? I have report panels that run for the previous month, and I want to show that month and year in a single value panel above each report.
Thanks!
Try something like this for your single value panel search
| gentimes start=-1 | eval lastmonth=strftime(relative_time(now(),"-1mon"),"%b %Y") | table lastmonth
Try something like this for your single value panel search
| gentimes start=-1 | eval lastmonth=strftime(relative_time(now(),"-1mon"),"%b %Y") | table lastmonth
Thanks! This works! It just seems to take a long time to run for some reason.
How can i display last 6 moths starting from the current.
Jan 2019
Dec 2018
Nov 2019
Oct 2018
Hi sbhantnagr88
| gentimes start=-6 | eval lastmonth=strftime(relative_time(now(),"-6mon"),"%b %Y") | table lastmonth
Strange. These (gentimes and now() both) are one of the fastest command I've seen (auto-generating command, doesn't access any index).
I added |head 1, and everything is just fine.
Thanks!