<?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: Splunk and Custom Scripts in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435219#M7561</link>
    <description>&lt;P&gt;If I understand it correctly then, once an alert is triggered from a search I can send that information in an email notification or launch a script.  Not both.  Damn.&lt;/P&gt;

&lt;P&gt;Is there any way that I can trigger a script to run in the search then, and add the resulting data to the alert?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jul 2018 14:19:12 GMT</pubDate>
    <dc:creator>OldManEd</dc:creator>
    <dc:date>2018-07-11T14:19:12Z</dc:date>
    <item>
      <title>Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435217#M7559</link>
      <description>&lt;P&gt;Time to ask the experts out there;&lt;/P&gt;

&lt;P&gt;Is it possible to create a scheduled search, and based on some criteria create an email alert, but before sending the alert out, run a custom Python script, collect specific data from another system, add that data to the alert email and send all that out?  I've been going through the documentation and can't find the the specific information I'm looking for.  I'm looking for a simple yes/no answer and then if yes, where to find the documentation.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435217#M7559</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2018-07-11T13:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435218#M7560</link>
      <description>&lt;P&gt;Email and script are two different parallel actions for an alert. You can not make them interdependent. Perhaps you should use the script itself to send an email instead of splunk email.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435218#M7560</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2018-07-11T13:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435219#M7561</link>
      <description>&lt;P&gt;If I understand it correctly then, once an alert is triggered from a search I can send that information in an email notification or launch a script.  Not both.  Damn.&lt;/P&gt;

&lt;P&gt;Is there any way that I can trigger a script to run in the search then, and add the resulting data to the alert?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 14:19:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435219#M7561</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2018-07-11T14:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435220#M7562</link>
      <description>&lt;P&gt;You can run both, but they will happen at the same time.  You may want to try two alerts.  One that runs the script and possibly creates a new event in Splunk.  A second alert could trigger off of the new event which would have the info you need.  Probably other ways to do it, but this could be an option for you.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 14:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435220#M7562</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2018-07-11T14:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435221#M7563</link>
      <description>&lt;P&gt;So the process steps would be;&lt;BR /&gt;
1. The search would run and trigger an alert&lt;BR /&gt;
2. That alert would trigger the script passing data to it - no email&lt;BR /&gt;
3. The script would run, collect additional data and trigger a second alert.  This second alert would then finally send the email notice.&lt;/P&gt;

&lt;P&gt;Whoa, and Splunk is not set up to run a script within the search first to avoid all the other steps - right?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 14:52:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435221#M7563</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2018-07-11T14:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435222#M7564</link>
      <description>&lt;P&gt;OK, I think I found something called "External Fields Lookup" in the documentation.  It describes the Python script called "external_lookup.py" that is shipped with Splunk already configured.  I have used this previously and it works.  Basically one passes an IP and the script will send back a hostname.  The call is "sourcetype=access_combined | eval clienthost = host | lookup dnslookup clienthost | stats count by clientip".  I can use that as a model and instead of making a DNS call, I'll run my internal call in the Python script.  This way I can collect the required data within the search prior to creating the alert.  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435222#M7564</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2020-09-29T20:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435223#M7565</link>
      <description>&lt;P&gt;Yup, this worked.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 20:34:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435223#M7565</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2018-07-25T20:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk and Custom Scripts</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435224#M7566</link>
      <description>&lt;P&gt;Creating a dynamic lookup with a python script solved this problem.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 20:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-and-Custom-Scripts/m-p/435224#M7566</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2018-07-25T20:39:06Z</dc:date>
    </item>
  </channel>
</rss>

