<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bulk enabling alerts in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687868#M10045</link>
    <description>&lt;P&gt;You could try to do it using REST API but I'd say it's not a best idea. If you enable too many searches, you're gonna kill your servers. So it's best to enable those you need, not just all there are.&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2024 13:01:13 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-05-17T13:01:13Z</dc:date>
    <item>
      <title>Bulk enabling alerts</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687863#M10041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way of bulk enabling alerts in Splunk enterprise?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 12:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687863#M10041</guid>
      <dc:creator>joe06031990</dc:creator>
      <dc:date>2024-05-17T12:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk enabling alerts</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687868#M10045</link>
      <description>&lt;P&gt;You could try to do it using REST API but I'd say it's not a best idea. If you enable too many searches, you're gonna kill your servers. So it's best to enable those you need, not just all there are.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 13:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687868#M10045</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-05-17T13:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk enabling alerts</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687879#M10048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49272"&gt;@joe06031990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;it's a request from many of us,&lt;/P&gt;&lt;P&gt;go in Splunk ideas and vote for it: maybe someone in the Splunk project will consider the request!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 13:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687879#M10048</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-17T13:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk enabling alerts</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687886#M10051</link>
      <description>&lt;P&gt;A while ago, I had to enable a number of alerts (saved searches) for an app&lt;BR /&gt;&lt;BR /&gt;I created a simple bash file (Assuming your Linux based) which used the API, and this ran through them. Take note of what&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp; said&amp;nbsp; you could end up with a performance issue if you enable too&amp;nbsp; many.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This worked for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to create a Splunk token, and get a list your target alerts (saved searches) in your App , then add them to the bash script, a bit of home work, yes, but it got the job done in the end for me.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is an example bash script&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/bin/bash
# Define your variables
TOKEN="MY SPLUNK TOKEN"

SERVER="https://MY_SPLUNK_SERVER_SH:8089"
APP="MY_APP"

# Define alerts
ALERTS=("my_alert1" "my_alert2")

# Loop through each alert and enable it
for ALERT in "${ALERTS[@]}"; do
  echo "Enabling alert: $ALERT"
  curl -X POST -k -H "Authorization: Bearer $TOKEN" "$SERVER/servicesNS/nobody/$APP/saved/searches/$ALERT" -d disabled=0

  if [ $? -eq 0 ]; then
   echo "Alert $ALERT enabled successfully."
   sleep 10
  else
    echo "Failed to enable alert $ALERT."
  fi
done&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;You can use the below to find your alert searches names&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest splunk_server=local /services/saved/searches 
| fields splunk_server, author, title, disabled, eai:acl.app, eai:acl.owner, eai:acl.sharing, id, search 
| rename title AS saved_search_name eai:acl.app AS app eai:acl.owner AS owner eai:acl.sharing AS sharing search AS spl_code 
| eval is_enabled = case(disabled &amp;gt;=1, "disabled",1=1, "enabled") 
```| search app=YOUR APP NAME ```
| table splunk_server, author, saved_search_name, disabled, is_enabled, app, owner, sharing, spl_code&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 14:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Bulk-enabling-alerts/m-p/687886#M10051</guid>
      <dc:creator>deepakc</dc:creator>
      <dc:date>2024-05-17T14:23:01Z</dc:date>
    </item>
  </channel>
</rss>

