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
Motivator

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
Motivator

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
Motivator

Great!Can you please Accept my answer?

0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...