<?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 group results to be emailed to appropriate support team based on server in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/group-results-to-be-emailed-to-appropriate-support-team-based-on/m-p/454375#M171248</link>
    <description>&lt;P&gt;I'm looking to  search for multiple errors and exceptions across application logs for across multiple servers.&lt;/P&gt;

&lt;P&gt;using a host_email.csv lookup table containing:&lt;BR /&gt;
host, email_address&lt;/P&gt;

&lt;P&gt;How can group these by error/exception type per server send email to corresponding team based on server. I would like to include in my email alert the alert message, server, and count. My search is not working:&lt;/P&gt;

&lt;P&gt;| lookup host_email.csv &lt;BR /&gt;
| search "error1" OR "error2" OR "error3" OR "error4" OR "exception1" OR "exception2" OR "exception3" | stats count values(_raw) by host&lt;BR /&gt;
| search action.email=1 action.email.to=email_address &lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:30:21 GMT</pubDate>
    <dc:creator>splunkhan</dc:creator>
    <dc:date>2020-09-30T00:30:21Z</dc:date>
    <item>
      <title>group results to be emailed to appropriate support team based on server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-results-to-be-emailed-to-appropriate-support-team-based-on/m-p/454375#M171248</link>
      <description>&lt;P&gt;I'm looking to  search for multiple errors and exceptions across application logs for across multiple servers.&lt;/P&gt;

&lt;P&gt;using a host_email.csv lookup table containing:&lt;BR /&gt;
host, email_address&lt;/P&gt;

&lt;P&gt;How can group these by error/exception type per server send email to corresponding team based on server. I would like to include in my email alert the alert message, server, and count. My search is not working:&lt;/P&gt;

&lt;P&gt;| lookup host_email.csv &lt;BR /&gt;
| search "error1" OR "error2" OR "error3" OR "error4" OR "exception1" OR "exception2" OR "exception3" | stats count values(_raw) by host&lt;BR /&gt;
| search action.email=1 action.email.to=email_address &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-results-to-be-emailed-to-appropriate-support-team-based-on/m-p/454375#M171248</guid>
      <dc:creator>splunkhan</dc:creator>
      <dc:date>2020-09-30T00:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: group results to be emailed to appropriate support team based on server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-results-to-be-emailed-to-appropriate-support-team-based-on/m-p/454376#M171249</link>
      <description>&lt;P&gt;Hi splunkhan,&lt;/P&gt;

&lt;P&gt;untested and just making this up, but something like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup host_email.csv 
| search "error1" OR "error2" OR "error3" OR "error4" OR "exception1" OR "exception2" OR "exception3" | stats count values(_raw) by host
| search action.email=1 action.email.to=email_address
| map maxsearches=0 search="stats count 
| fields - count 
| sendemail from=buttercup@splunk.com to=$action.email$ subject=$alert.subject$ message=$alert.message$ sendresults=true"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might need to modify to work correct, and read about the &lt;CODE&gt;sendemail&lt;/CODE&gt; command here &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sendemail"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sendemail&lt;/A&gt; and the &lt;CODE&gt;map&lt;/CODE&gt; command here &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 06:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-results-to-be-emailed-to-appropriate-support-team-based-on/m-p/454376#M171249</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-05-14T06:03:31Z</dc:date>
    </item>
  </channel>
</rss>

