<?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: Send emailed results to an email address IN the results. in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/528170#M1128</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt; ,&lt;BR /&gt;By using your solution, it wll send email event "no found results" because of map command. How to stop sending email when thery are empty?&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;| inputlookup mail.csv | fields adresse_mail | map search="|savedsearch abc | where Adresse_mail=\"$adresse_mail$\" |fields - Adresse_mail&lt;BR /&gt;|sendemail to=\"$adresse_mail$\" subject=...&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2020 16:44:23 GMT</pubDate>
    <dc:creator>thuhuongle</dc:creator>
    <dc:date>2020-11-05T16:44:23Z</dc:date>
    <item>
      <title>Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233878#M1118</link>
      <description>&lt;P&gt;I want to be able to email results to recipients where the recipient email address is PART of the result set.  &lt;/P&gt;

&lt;P&gt;For example, lets assume the following is my result set in Splunk. &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1319i051E52CF4A6790AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Now I want to have Splunk send an automated email for EACH RESULT where the recipient of the email is the value of the "Email_Address" field. &lt;/P&gt;

&lt;P&gt;I.E: Email 1 contains results from row 1 ONLY and the recipient of that email is &lt;A href="mailto:jon.snow@got.com"&gt;jon.snow@got.com&lt;/A&gt;, etc.&lt;/P&gt;

&lt;P&gt;I am pretty sure it is not possible in native Splunk but I am curious to know if anyone has come up with a custom solution. &lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 15:50:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233878#M1118</guid>
      <dc:creator>jdunlea</dc:creator>
      <dc:date>2016-05-06T15:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233879#M1119</link>
      <description>&lt;P&gt;You can use  tokens to pass "TO:" in email notifications.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Setupalertactions"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Setupalertactions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;$Email_Address$&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Courtesy Snow is back.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 06 May 2016 15:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233879#M1119</guid>
      <dc:creator>jensonthottian</dc:creator>
      <dc:date>2016-05-06T15:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233880#M1120</link>
      <description>&lt;P&gt;Thanks Jenson!&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 16:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233880#M1120</guid>
      <dc:creator>jdunlea</dc:creator>
      <dc:date>2016-05-06T16:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233881#M1121</link>
      <description>&lt;P&gt;If you need to send a contextually-approrpriate subset of results to some people, you can skip the configuration-based email settings and do this in SPL directly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | outputcsv TempFile.csv
| stats values(Email_Address) AS emailToHeader | mvexpand emailToHeader
| map search="|inputcsv TempFile.csv | where Email_Addresss=\"$emailToHeader$\"
   | fields - Email_Address
   | sendemail
      sendresults=true inline=true
      server=\"Your.Value.Here\"
      from=\"Your.Value.Here\"
      to=\"$emailToHeader$\"
      subject=\"Your Subject here: \$name\$\"
      message=\"This report alert was generated by \$app\$ Splunk with this search string: \$search\$\""
| search ThisFieldWillNeverExist="SoThisCommandWillDropAllEventsSoThatYouCanPullInTheOriginalSetWhichYouMightOrMightNotCareToDo"
| appendpipe [|inputcsv TempFile.csv]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only downside to this approach is that If the search does not return any results it will produce the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Error in "map": Did not find value for required attributes 'emailToHeader'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is "normal" and I have not found a good way to code around it.&lt;/P&gt;</description>
      <pubDate>Sat, 07 May 2016 13:45:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233881#M1121</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-07T13:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233882#M1122</link>
      <description>&lt;P&gt;Thanks Jenson&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 19:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233882#M1122</guid>
      <dc:creator>brothersman</dc:creator>
      <dc:date>2016-06-13T19:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233883#M1123</link>
      <description>&lt;P&gt;I believe you need $results.Email_Address$&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 09:42:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233883#M1123</guid>
      <dc:creator>nunoaragao</dc:creator>
      <dc:date>2017-03-31T09:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233884#M1124</link>
      <description>&lt;P&gt;Not sure how this answers the question. &lt;BR /&gt;
what's the SPL for sending multiple emails with recipients based on fields in the result set with the data that is relevant for each user?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:47:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233884#M1124</guid>
      <dc:creator>AssafLowenstein</dc:creator>
      <dc:date>2018-03-15T11:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233885#M1125</link>
      <description>&lt;P&gt;I got around the error for no results by adding the following immediately before the map command &lt;BR /&gt;
|append [|makeresults |eval ] &lt;/P&gt;

&lt;P&gt;e.g. |append [|makeresutls |eval emailToHeader=""]&lt;/P&gt;

&lt;P&gt;I also added "graceful=true" to the sendemail command to ignore errors about trying to send an email with no "to"&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 14:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233885#M1125</guid>
      <dc:creator>elewis1</dc:creator>
      <dc:date>2019-11-22T14:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233886#M1126</link>
      <description>&lt;P&gt;Yes, I also found a solution to the &lt;CODE&gt;empty map&lt;/CODE&gt; problem later on.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2019 00:25:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/233886#M1126</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-23T00:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/522278#M1127</link>
      <description>&lt;P&gt;Hi Woodcock, Do you have a solution without using sendemail commend but can parse the token to the alert by email.&lt;BR /&gt;Great solution with |sendemail&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 15:46:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/522278#M1127</guid>
      <dc:creator>thuhuongle</dc:creator>
      <dc:date>2020-09-30T15:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/528170#M1128</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt; ,&lt;BR /&gt;By using your solution, it wll send email event "no found results" because of map command. How to stop sending email when thery are empty?&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;| inputlookup mail.csv | fields adresse_mail | map search="|savedsearch abc | where Adresse_mail=\"$adresse_mail$\" |fields - Adresse_mail&lt;BR /&gt;|sendemail to=\"$adresse_mail$\" subject=...&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 16:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/528170#M1128</guid>
      <dc:creator>thuhuongle</dc:creator>
      <dc:date>2020-11-05T16:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/542047#M1129</link>
      <description>&lt;P&gt;SPL for sending email based on email address value in the result:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base search&amp;gt;
| table User Email_Address
| sendemail to=$result.Email_Address$ subject=$result.User$ ...&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.2/Alert/EmailNotificationTokens#Result_tokens" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.2/Alert/EmailNotificationTokens#Result_tokens&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 21:02:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/542047#M1129</guid>
      <dc:creator>splunkyfun12721</dc:creator>
      <dc:date>2021-03-02T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Send emailed results to an email address IN the results.</title>
      <link>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/573712#M1130</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;This is very helpful, and somewhat of a game changer in sending dynamic alerts from Splunk. Thank you!&lt;/P&gt;&lt;P&gt;I did have a quick question about outputcsv.&lt;/P&gt;&lt;P&gt;From what I've read, outputlookup writes to a lookup file that replicates across a search head cluster, while outputcsv just writes a CSV in the current search head's var/run directory. I'm looking to have this result dataset NOT be persistent. Do you have any recommendations about creating a result dataset for the map command that will age out after the search is run, or some configurable time after?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 22:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Send-emailed-results-to-an-email-address-IN-the-results/m-p/573712#M1130</guid>
      <dc:creator>ejwade</dc:creator>
      <dc:date>2021-11-04T22:47:15Z</dc:date>
    </item>
  </channel>
</rss>

