Splunk Enterprise

Add new code to existing alerts

sravani27
Path Finder

Hi, I have over 150 alerts to which I have to add new lines of code like below example. I am updating each alert manually and it is getting tedious. Is there a way to update all the alerts in bulk? I also want to add additional alert action (send Webex teams notification) along with the existing send email action. Can anyone please suggest a way to do it?

eg: old alert search

|makeresults | eval message="Hi How are you"

New alert search

|makeresults| eval message="Hi How are you"| eval message2= "this is message2" |eval message3="this is message3"

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I'm suggesting using your favorite editor to make bulk changes within the config file(s).

Don't forget to restart the search head after editing to apply the changes.

---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

If you have access to the CLI and the alerts are in one (or a few) app then you can use an editor to make the changes quickly.  Like this, in vim

1,$ s/|makeresults| eval message="Hi How are you"/|makeresults| eval message="Hi How are you"| eval message2= "this is message2" |eval message3="this is message3"/

The actual command will depend on how varied the alerts are.

---
If this reply helps you, Karma would be appreciated.

sravani27
Path Finder

@richgalloway  Thanks for your response. Are you suggesting updating individual alerts using CLI? 

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...