<?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: How to send specific set of data to specific recipient? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349558#M11946</link>
    <description>&lt;P&gt;try this eval:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval recipient=case(Domain="HR","h1@gmail.com",Domain="Hi","h2@gmail.com",Domain="Hl","h3@gmail.com")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and see if that works.&lt;BR /&gt;
and in the TO field: &lt;CODE&gt;$result.recipient$&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 14:58:28 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-06-19T14:58:28Z</dc:date>
    <item>
      <title>How to send specific set of data to specific recipient?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349557#M11945</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have a set of data in the following manner.&lt;/P&gt;

&lt;P&gt;Domain     Application      TicketId      Hours        Recipient&lt;BR /&gt;
HR               abb                  123rrr         121              &lt;A href="mailto:h1@gmail.com"&gt;h1@gmail.com&lt;/A&gt;&lt;BR /&gt;
HR               hhg                  145rew       100              &lt;A href="mailto:h1@gmail.com"&gt;h1@gmail.com&lt;/A&gt;&lt;BR /&gt;
Hi                aby                   123rrt         120              &lt;A href="mailto:h2@gmail.com"&gt;h2@gmail.com&lt;/A&gt;&lt;BR /&gt;
Hi                hhu                  145rty         109              &lt;A href="mailto:h2@gmail.com"&gt;h2@gmail.com&lt;/A&gt;&lt;BR /&gt;
Hl                abo                  123rhg        127              &lt;A href="mailto:h3@gmail.com"&gt;h3@gmail.com&lt;/A&gt;&lt;BR /&gt;
Hl                hhi                   145rll           105              &lt;A href="mailto:h3@gmail.com"&gt;h3@gmail.com&lt;/A&gt;&lt;BR /&gt;
Hl               abp                123rkh     123          &lt;A href="mailto:h3@gmail.com"&gt;h3@gmail.com&lt;/A&gt;&lt;BR /&gt;
Tm                hhp              145rfdf   100          &lt;A href="mailto:h4@gmail.com"&gt;h4@gmail.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The query which i have written generates this:&lt;BR /&gt;
"search query|eval recipient=case(Domain=HR,recipient=&lt;A href="mailto:h1@gmail.com"&gt;h1@gmail.com&lt;/A&gt;,Domain=Hi,recipient=&lt;A href="mailto:h2@gmail.com"&gt;h2@gmail.com&lt;/A&gt;,Domain=Hl,recipient=&lt;A href="mailto:h3@gmail.com"&gt;h3@gmail.com&lt;/A&gt;)|"&lt;BR /&gt;
so that it sends specific data to specific recipients as mail alerts.&lt;BR /&gt;
Like If domain is HR then all data related to hr should go to &lt;A href="mailto:h1@gmail.com"&gt;h1@gmail.com&lt;/A&gt; not the data of remaining domains.&lt;BR /&gt;
In my mail alerts settings also alert mode="once per search" mode and in the TO filed it is $recipient.result$ , but still mail is not sending specific results to specific recipients.It is sending the whole data &lt;/P&gt;

&lt;P&gt;Please suggest what should be done&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 12:22:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349557#M11945</guid>
      <dc:creator>ASISH_9</dc:creator>
      <dc:date>2017-06-19T12:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to send specific set of data to specific recipient?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349558#M11946</link>
      <description>&lt;P&gt;try this eval:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval recipient=case(Domain="HR","h1@gmail.com",Domain="Hi","h2@gmail.com",Domain="Hl","h3@gmail.com")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and see if that works.&lt;BR /&gt;
and in the TO field: &lt;CODE&gt;$result.recipient$&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 14:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349558#M11946</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-06-19T14:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to send specific set of data to specific recipient?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349559#M11947</link>
      <description>&lt;P&gt;You need to select alert mode as once per result. Be aware that with your current search, it may send duplicate alerts if there are multiple records for each email address. To avoid that you can do like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current query generating above output | stats list(*) as * by Recipient
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, the to field should be &lt;CODE&gt;$result.recipient$&lt;/CODE&gt; Is that a typo in your post?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 15:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349559#M11947</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-19T15:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to send specific set of data to specific recipient?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349560#M11948</link>
      <description>&lt;P&gt;Thanks this worked&lt;BR /&gt;
But now the problem is the mail is not sent in a organised format.&lt;BR /&gt;
like i was expecting: &lt;BR /&gt;
recipient                     Domain    Application&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="mailto:h1@gmail.com"&gt;h1@gmail.com&lt;/A&gt;          HR              abc&lt;BR /&gt;&lt;BR /&gt;
                                     HR              hhg                 &lt;/P&gt;

&lt;P&gt;rather it came in this way&lt;BR /&gt;
recipient                 Domain              Application&lt;BR /&gt;
&lt;A href="mailto:h1@gmail.com"&gt;h1@gmail.com&lt;/A&gt;          HR HR            abc hhg&lt;/P&gt;

&lt;P&gt;can we bring  the table in  first format?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 09:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-specific-set-of-data-to-specific-recipient/m-p/349560#M11948</guid>
      <dc:creator>ASISH_9</dc:creator>
      <dc:date>2017-06-20T09:32:59Z</dc:date>
    </item>
  </channel>
</rss>

