<?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 stats be in the subject of an alert-generated e-mail? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502786#M139916</link>
    <description>&lt;P&gt;The alert used to contain a table of all of the detected oracle-errors -- four fields enumerated in my question. Now it contains only &lt;EM&gt;two&lt;/EM&gt; fields: the App and the incidence. And the second column is empty...&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2019 21:12:19 GMT</pubDate>
    <dc:creator>unitedmarsupial</dc:creator>
    <dc:date>2019-12-09T21:12:19Z</dc:date>
    <item>
      <title>Can stats be in the subject of an alert-generated e-mail?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502782#M139912</link>
      <description>&lt;P&gt;We have an alert, that checks for a particular condition (Oracle-errors) across multiple indexes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=HOP OR index=FOO OR index=BAR) AND Description=ORA-*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The e-mail is sent to multiple people. I'd like the subject of the e-mail generated to contain the output of &lt;CODE&gt;stats sum(count) by index&lt;/CODE&gt; -- to help people responsible for the different applications prioritize their work... Can things like this be done?&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Update&lt;/EM&gt;: I attempted to follow the advice by @aberkow adding the last line like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....
| eval App=upper(index) 
| fields App, _time, Description, source
| stats sum(count) as incidence by App
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then adding &lt;CODE&gt;$result.incidence$&lt;/CODE&gt; to the subject. Unfortunately, this did not add the actual counts to the Subject. Worse, the body of the e-mail -- instead of listing the four fields specified, now lists only &lt;EM&gt;two&lt;/EM&gt; columns: the App and the incidence. And the latter column is &lt;EM&gt;empty&lt;/EM&gt;...&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 17:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502782#M139912</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2019-12-09T17:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can stats be in the subject of an alert-generated e-mail?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502783#M139913</link>
      <description>&lt;P&gt;Do you mean something like this? &lt;A href="https://answers.splunk.com/answers/785739/is-it-possible-to-have-a-token-in-the-saved-search.html#answer-784991"&gt;https://answers.splunk.com/answers/785739/is-it-possible-to-have-a-token-in-the-saved-search.html#answer-784991&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I think you're saying that you want to add in a token in the subject, which is super doable &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats sum(count) as countOfWhatever by index&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Subject: $result.countOfWhatever$ unindexed or unsupported or...&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/Alert/EmailNotificationTokens#Result_tokens:"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/Alert/EmailNotificationTokens#Result_tokens:&lt;/A&gt; for the same info linked in that other question! &lt;/P&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 18:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502783#M139913</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-12-09T18:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can stats be in the subject of an alert-generated e-mail?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502784#M139914</link>
      <description>&lt;P&gt;Thanks.That removed all of the events from the e-mail's body -- replacing them with the incidence per index. Can I keep the alert-body as it was, but still have the per-index summary in Subject?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 19:18:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502784#M139914</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2019-12-09T19:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can stats be in the subject of an alert-generated e-mail?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502785#M139915</link>
      <description>&lt;P&gt;Good call out - I made the update. That's interesting, what is in your alert-body before? Was it also a token? It shouldn't have affected it, although most of the time I just send $results_link$ as a best practice.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 19:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502785#M139915</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-12-09T19:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can stats be in the subject of an alert-generated e-mail?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502786#M139916</link>
      <description>&lt;P&gt;The alert used to contain a table of all of the detected oracle-errors -- four fields enumerated in my question. Now it contains only &lt;EM&gt;two&lt;/EM&gt; fields: the App and the incidence. And the second column is empty...&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 21:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-stats-be-in-the-subject-of-an-alert-generated-e-mail/m-p/502786#M139916</guid>
      <dc:creator>unitedmarsupial</dc:creator>
      <dc:date>2019-12-09T21:12:19Z</dc:date>
    </item>
  </channel>
</rss>

