Reporting

How to include search start and end date of the search in email subject?

tomasz
Engager

Hi all

I would like to include the start and end date of my search in the email subject. For example, 'The results from 2022-11-01 to 2022-11-11'. I tried the email tokens $job.earliestTime$ and $job.latestTime$ but they also give me time which just obscures the title. Is there any way to retrieve just the dates? Any help much appreciated.

Cheers

Tom

Labels (1)
0 Karma
1 Solution

PaulPanther
Builder

Use addinfo and then use $result.search_starttime$ & $result.search_endtime$ in your alert action

 

| addinfo
| eval search_starttime = strftime(info_min_time, "%Y-%m-%d")
| eval search_endtime = strftime(info_max_time, "%Y-%m-%d")
| table search_starttime search_endtime

 

 

View solution in original post

PaulPanther
Builder

Use addinfo and then use $result.search_starttime$ & $result.search_endtime$ in your alert action

 

| addinfo
| eval search_starttime = strftime(info_min_time, "%Y-%m-%d")
| eval search_endtime = strftime(info_max_time, "%Y-%m-%d")
| table search_starttime search_endtime

 

 

tomasz
Engager

Hi Paul

Your answer has done exactly what I wanted.

Thank you very much.

 

0 Karma

PaulPanther
Builder

Great!Can you please Accept my answer?

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 ...