Alerting

Get the search query time range in the Alert message body

dchoubey
Engager

Hello All, 

I have a requirement to display the search query time range in the body of the email alert, is there a way i can do that? 

Search:

index="ABC" source=XYZ earliest=-3month latest=now| table ClientId Restricted Success Rejected Failed Total 

 

I want to display the time range that my search considered in the email alert. 

Thank you

Labels (2)
0 Karma
1 Solution

thambisetty
Super Champion

https://docs.splunk.com/Documentation/Splunk/8.0.6/Alert/EmailNotificationTokens#Job_information_tok...

you can use email Notification tokens in your email body.

$job.earliestTime$

$job.latestTime$

————————————
If this helps, give a like below.

View solution in original post

inventsekar
Super Champion
$job.earliestTime$Initial job start time

....the initial job start time is the alert job start time or the "earliest" time the search query time?!?!

or, you can include the whole search query as well (which includes the earliest and latest times)

$search$

Search string
PS ... If any post helped you in any way, pls give a hi-five to the author with an upvote. if your issue got resolved, please accept the reply as solution.. thanks.

thambisetty
Super Champion

https://docs.splunk.com/Documentation/Splunk/8.0.6/Alert/EmailNotificationTokens#Job_information_tok...

you can use email Notification tokens in your email body.

$job.earliestTime$

$job.latestTime$

————————————
If this helps, give a like below.
Get Updates on the Splunk Community!

Observability Highlights | January 2023 Newsletter

 January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...

Security Highlights | January 2023 Newsletter

January 2023 Splunk Security Essentials (SSE) 3.7.0 ReleaseThe free Splunk Security Essentials (SSE) 3.7.0 app ...

Platform Highlights | January 2023 Newsletter

 January 2023Peace on Earth and Peace of Mind With Business ResilienceAll organizations can start the new year ...