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!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...