Reporting

How to display previous month's name in the subject of a scheduled report?

loveforsplunk
Explorer

I have a report scheduled on 2nd of every month, giving the whole data of the previous month.

I would like to have it emailed with subject "Report for the month of "previous month". How do I display the previous month's name in the subject of the report automatically?

0 Karma

lguinn2
Legend

I am not sure how to include a name in the title, but there probably is a way...
However, if you are creating a scheduled dashboard, you could have a panel in your dashboard like this:

| makeresults
| eval previous_month_begin = relative_time(now(),"-1mon@mon") 
| eval "Previous Month Start" = strftime(previous_month_begin, "%B %d, %Y") 
| eval previous_month_end = relative_time(now(),"@mon-1m") 
| eval "Previous Month End" = strftime(previous_month_end, "%B %d, %Y") 
| eval heading = 'Previous Month Start' " to " 'Previous Month End'
| fields heading

which makes a beautiful heading. You might want to show it as a single value panel at the top of the dashboard.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...