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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...