<?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: Can an alert's actions be data-driven? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471128#M132533</link>
    <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Alert/Aboutalerts"&gt;About alerts&lt;/A&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Priority High &amp;gt; send mail&lt;BR /&gt;
Priority Normal &amp;gt; nothing&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Priority High &amp;gt; send mail and "priority high message"&lt;BR /&gt;
Priority Normal &amp;gt; send mail and "priority normal message"&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;which one?&lt;/P&gt;</description>
    <pubDate>Sun, 22 Dec 2019 20:10:17 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2019-12-22T20:10:17Z</dc:date>
    <item>
      <title>Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471125#M132530</link>
      <description>&lt;P&gt;Suppose, one has an alert defined for checking multiple application-instances.&lt;/P&gt;

&lt;P&gt;Can the &lt;EM&gt;actions&lt;/EM&gt; defined for the alert be different depending on the results of the search? For example, the priority of the alert's email should be High for the production instance and normal for all others.&lt;/P&gt;

&lt;P&gt;Likewise, can the results of the search determine, whether a particular action (such as paging the sysadmin) is taken &lt;EM&gt;at all&lt;/EM&gt; -- regardless of the parameters?&lt;/P&gt;

&lt;P&gt;We'd really like to avoid having multiple &lt;EM&gt;copies&lt;/EM&gt; of the same alert just so that we can have slightly different actions for each...&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 16:24:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471125#M132530</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2019-12-19T16:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471126#M132531</link>
      <description>&lt;P&gt;how about write the logic to the search and configure the alert accordingly?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 18:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471126#M132531</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-12-19T18:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471127#M132532</link>
      <description>&lt;P&gt;"Accordingly" is the key, is not it? Suppose, I use &lt;CODE&gt;| eval Priority=if("Production", "High", "Normal")&lt;/CODE&gt; -- how can I make the &lt;CODE&gt;$result.Priority$&lt;/CODE&gt; affect that of the generated alert-email?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 21:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471127#M132532</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2019-12-20T21:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471128#M132533</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Alert/Aboutalerts"&gt;About alerts&lt;/A&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Priority High &amp;gt; send mail&lt;BR /&gt;
Priority Normal &amp;gt; nothing&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Priority High &amp;gt; send mail and "priority high message"&lt;BR /&gt;
Priority Normal &amp;gt; send mail and "priority normal message"&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;which one?&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2019 20:10:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471128#M132533</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-22T20:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471129#M132534</link>
      <description>&lt;P&gt;&lt;EM&gt;Both&lt;/EM&gt; would be useful, but the 1. -- especially so... Thank you, @to4kawa!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 16:10:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471129#M132534</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2019-12-23T16:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471130#M132535</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;your search 
| eval Priority=if(your_Production_condition, "High", "Normal")
| where Priority="High"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @unitedmarsupials&lt;BR /&gt;
Event count &amp;gt; 0 , you can run alerting and action &lt;EM&gt;send email&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 00:02:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471130#M132535</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-24T00:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471131#M132536</link>
      <description>&lt;P&gt;Thank you, this may be suitable in the cases, when there is only one action -- because this method determines, whether the alert fires &lt;EM&gt;at all&lt;/EM&gt;. We have multiple actions -- and would like to skip some of them, but not all... Can that be done? Maybe, actions can have additional searches to append to the "base" one -- the way dashboard's panels can have?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 15:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471131#M132536</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2019-12-24T15:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471132#M132537</link>
      <description>&lt;P&gt;If you are talking about email, if you move to &lt;CODE&gt;sendemail&lt;/CODE&gt; inside of your SPL and ditch the &lt;CODE&gt;Alert Action&lt;/CODE&gt; method.  You will now have complete control.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 18:23:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471132#M132537</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-24T18:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471133#M132538</link>
      <description>&lt;P&gt;Take your alert out of &lt;CODE&gt;digest&lt;/CODE&gt; mode by setting it to &lt;CODE&gt;For Each Result&lt;/CODE&gt;.  Then you can use &lt;CODE&gt;priority=$result.priority$&lt;/CODE&gt; in the subject line of your email after doing something like this in your SPL:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your foundation search and other stuff here
| eval priority=case(
    condition=="bad", "High",
    condition=="really bad", "Critical",
    true(), "Low")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Dec 2019 18:28:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471133#M132538</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-24T18:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471134#M132539</link>
      <description>&lt;P&gt;As @woodcock  says, it's appropriate to separate priorities for each desired action.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2019 01:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471134#M132539</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-25T01:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471135#M132540</link>
      <description>&lt;P&gt;I think that what you are really looking for is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your foundation search and other stuff here
| eval priority=case(
     condition=="bad", "high",
     condition=="really bad", "highest",
     true(), "normal")
| outputlookup MyTempLookup.csv
| stats count by priority
| map maxsearches=5 search="|inputlookup MyTempLookup.csv
                            | search priority=$priority$
                            | sendemail priority=$priority$ to=\"who@where.com\" format=raw subject=\"My Subject\" sendresults=true"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is based off of my answer here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/489475/how-configure-an-alert-to-send-an-email-based-on-f.html"&gt;https://answers.splunk.com/answers/489475/how-configure-an-alert-to-send-an-email-based-on-f.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 16:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471135#M132540</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-27T16:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can an alert's actions be data-driven?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471136#M132541</link>
      <description>&lt;P&gt;Ah, so &lt;CODE&gt;sendmail&lt;/CODE&gt; is a function in itself? Is that true about all actions? For example, in addition to sending e-mail, our Splunk  instance can also trigger a Moogsoft-alert -- does that mean, there is a &lt;CODE&gt;moogsoft&lt;/CODE&gt; &lt;EM&gt;function&lt;/EM&gt; too? Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 20:30:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-an-alert-s-actions-be-data-driven/m-p/471136#M132541</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2020-01-02T20:30:28Z</dc:date>
    </item>
  </channel>
</rss>

