<?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 sending emails to users that appear in search results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360181#M162239</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;The question was asked before but I couldn't find a good answer anywhere. Here goes...&lt;BR /&gt;
I have a search result with multiple lines and the first column consists of emails of different persons that I need email. &lt;BR /&gt;
The rest of the columns also have information that needs to be included in the email. the information is different for each person/row.&lt;/P&gt;

&lt;P&gt;How can I send multiple emails to different recipients using sendmail with the recipient being the name in the first column and the email itself has information from the rest of the columns. &lt;/P&gt;

&lt;P&gt;Thanks. &lt;BR /&gt;
Assaf&lt;/P&gt;</description>
    <pubDate>Thu, 15 Mar 2018 13:52:23 GMT</pubDate>
    <dc:creator>AssafLowenstein</dc:creator>
    <dc:date>2018-03-15T13:52:23Z</dc:date>
    <item>
      <title>sending emails to users that appear in search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360181#M162239</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;The question was asked before but I couldn't find a good answer anywhere. Here goes...&lt;BR /&gt;
I have a search result with multiple lines and the first column consists of emails of different persons that I need email. &lt;BR /&gt;
The rest of the columns also have information that needs to be included in the email. the information is different for each person/row.&lt;/P&gt;

&lt;P&gt;How can I send multiple emails to different recipients using sendmail with the recipient being the name in the first column and the email itself has information from the rest of the columns. &lt;/P&gt;

&lt;P&gt;Thanks. &lt;BR /&gt;
Assaf&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:52:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360181#M162239</guid>
      <dc:creator>AssafLowenstein</dc:creator>
      <dc:date>2018-03-15T13:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails to users that appear in search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360182#M162240</link>
      <description>&lt;P&gt;Let's say your search results return fields named &lt;CODE&gt;recipient&lt;/CODE&gt;, &lt;CODE&gt;data1&lt;/CODE&gt;, &lt;CODE&gt;data2&lt;/CODE&gt;, and &lt;CODE&gt;data3&lt;/CODE&gt;, and you'd like to send the contents of the fields named data* to the user named in the recipient field. Here's how you'd do that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
| map search 
 [ | sendemail to=$recipient$ subject="some subject" from=youremail@yourself.com message="$data1$ and then more $data2$ and finally some $data3$" ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will run the subsearch once for each line of results from the base search, effectively shepherding the values from &lt;CODE&gt;recipient&lt;/CODE&gt; and &lt;CODE&gt;data*&lt;/CODE&gt; into the subsearch together.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:35:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360182#M162240</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-15T14:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails to users that appear in search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360183#M162241</link>
      <description>&lt;P&gt;Thanks elliotproebstel, &lt;BR /&gt;
when running your suggestion as is Splunk threw an error but some digging got me to the correct syntax (Adding it below for future referencing)&lt;/P&gt;

&lt;P&gt;base_search&lt;BR /&gt;
| map search="sendemail to= subject=\"need_to_escape\" from= message=\"$data1$ and then more $data2$ and finally some $data3$\" sendresults=true inline=true format=raw" &lt;/P&gt;

&lt;P&gt;Thanks, accepting as answer.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360183#M162241</guid>
      <dc:creator>AssafLowenstein</dc:creator>
      <dc:date>2020-09-29T18:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails to users that appear in search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360184#M162242</link>
      <description>&lt;P&gt;While you already have an answer, I'd suggest you also have a look at &lt;A href="https://splunkbase.splunk.com/app/1794/"&gt;sendresults&lt;/A&gt;, this can be useful for emailing the results of a search on a per-user basis...&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 11:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360184#M162242</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-03-19T11:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails to users that appear in search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360185#M162243</link>
      <description>&lt;P&gt;Thanks.. I'll look into that also.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 14:25:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/360185#M162243</guid>
      <dc:creator>AssafLowenstein</dc:creator>
      <dc:date>2018-03-19T14:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails to users that appear in search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/557757#M162244</link>
      <description>&lt;P&gt;It's pretty simple, don't even need to use map command. Just enable send email alert action and in to: field set $result.email$ (email - depend upon your field name in Splunk result) and select trigger "for each result". Email will be send to the respective email address for each line of result.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Emailnotification#Send_email_to_different_recipients_based_on_search_results" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Emailnotification#Send_email_to_different_recipients_based_on_search_results&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 07:41:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sending-emails-to-users-that-appear-in-search-results/m-p/557757#M162244</guid>
      <dc:creator>sirajnp</dc:creator>
      <dc:date>2021-06-30T07:41:18Z</dc:date>
    </item>
  </channel>
</rss>

