Other Usage

Add hostname to email subject line of splunk alert

searching
Loves-to-Learn Lots

Trying to edit the email subject line of alerts I am receiving.

I have tried adding host=$host$ to the base search and in the subject line and was unsuccessful.

 

I have tried using the $result. host$ macro and was unsuccessful as well.  

search looks like :

| stats latest(cpu_load_percent) AS "CPU Utilization" by host _time

| where 'CPU Utilization' >= 95

|dedup host

Labels (1)
0 Karma

_JP
Contributor
0 Karma

searching
Loves-to-Learn Lots

Still a little confused. I have tried both the $host and $name token and neither work. My search sends an alert when any host reach a certain level of CPU utilization. At times there are multiple host that show in the search. when adding the token in the subject line it appears in the email sent as $host or $name. An email is triggered for each host but the goal is to have the host name and value in the subject line.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...