<?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 get Splunk sendemail command to send multiple emails based on search results 2016 in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246927#M4908</link>
    <description>&lt;P&gt;Hi somesoni2,&lt;BR /&gt;
great JOB! &lt;BR /&gt;
thre was on typo, "| sendemail to=$cc_all$" and it will work perfectly.&lt;BR /&gt;
could you please explaine on more detail what " | map maxsearches=PutAnIntegerNumberHere search="| gentimes start=-1 |" means?&lt;/P&gt;

&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
    <pubDate>Fri, 13 May 2016 07:19:10 GMT</pubDate>
    <dc:creator>ThomasControlw1</dc:creator>
    <dc:date>2016-05-13T07:19:10Z</dc:date>
    <item>
      <title>How to get Splunk sendemail command to send multiple emails based on search results 2016</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246924#M4905</link>
      <description>&lt;P&gt;cheers @ all splunker,&lt;/P&gt;

&lt;P&gt;one more question of this topic. (How to get Splunk sendemail command to send multiple emails based on search results)&lt;BR /&gt;
I read a lot of stuff &amp;amp; take a lot of time but without success.&lt;BR /&gt;
why the following search sent only to TO Emailladress and the first Emailadress of searchresult.&lt;BR /&gt;
the goal is that all email recipient from search got an email.&lt;/P&gt;

&lt;P&gt;could please someone assit?&lt;/P&gt;

&lt;P&gt;SplunkCore V6.3.1&lt;BR /&gt;
Search:&lt;BR /&gt;
sourcetype=Authenticator user="*" action=Authentication status=Success&lt;BR /&gt;
| eval username =lower(user)&lt;BR /&gt;
| stats latest(_time) as Login by username&lt;BR /&gt;
| eval tnow =now()&lt;BR /&gt;
| eval diff =tnow - Login&lt;BR /&gt;
| convert ctime(Login)&lt;BR /&gt;
| convert ctime(tnow)&lt;BR /&gt;
| eval diff1 = strftime(diff,"%j")&lt;BR /&gt;
| join [ inputlookup userauth.csv&lt;BR /&gt;
| rename "# username" as username ]&lt;BR /&gt;
| eval cc_all=mvjoin(email, ",")&lt;BR /&gt;
| where diff1 &amp;gt; 90&lt;BR /&gt;
| table "first name" "last name" Login username "email" "mobile number" "diff1" cc_all&lt;BR /&gt;
| sort diff1&lt;BR /&gt;
| sendemail to=$result.bcc$ cc=&lt;A href="mailto:some@email.de" target="_blank"&gt;some@email.de&lt;/A&gt; format=html subject="short discription" from=&lt;A href="mailto:other.e@mail.de" target="_blank"&gt;other.e@mail.de&lt;/A&gt; priority=highest footer="text" server=smtp.1234.de sendresults=false&lt;/P&gt;

&lt;P&gt;the table result as aspected, the cc_all field has a lot of emailadreses to sent&lt;/P&gt;

&lt;P&gt;5/12/16 2:45:27.404 PM&lt;BR /&gt;&lt;BR /&gt;
2016-05-12 14:45:27,404 +0200 INFO  sendemail:112 - Sending email. subject="short discription", results_link="None", recipients="[u'&lt;A href="mailto:thxxog@cxxe.de" target="_blank"&gt;thxxog@cxxe.de&lt;/A&gt;', u'&lt;A href="mailto:first@result.email.adresse" target="_blank"&gt;first@result.email.adresse&lt;/A&gt;']", server="smtp.1234.de"&lt;BR /&gt;
    source = /opt/splunk/var/log/splunk/python.log&lt;/P&gt;

&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246924#M4905</guid>
      <dc:creator>ThomasControlw1</dc:creator>
      <dc:date>2020-09-29T09:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Splunk sendemail command to send multiple emails based on search results 2016</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246925#M4906</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=Authenticator user="*" action=Authentication status=Success
| eval username =lower(user)
| stats latest(_time) as Login by username
| eval tnow =now()
| eval diff =tnow - Login
| convert ctime(Login)
| convert ctime(tnow)
| eval diff1 = strftime(diff,"%j")
| join [ inputlookup userauth.csv
| rename "# username" as username ]
| eval cc_all=mvjoin(email, ",")
| where diff1 &amp;gt; 90
| table "first name" "last name" Login username "email" "mobile number" "diff1" cc_all
| sort diff1 | map maxsearches=PutAnIntegerNumberHere search="| gentimes start=-1 | sendemail to=$bcc$ cc=some@email.de format=html subject=\"short discription\" from=other.e@mail.de priority=highest footer=\"text\" server=smtp.1234.de sendresults=false"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 May 2016 19:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246925#M4906</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-12T19:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Splunk sendemail command to send multiple emails based on search results 2016</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246926#M4907</link>
      <description>&lt;P&gt;Hi somesoni2,&lt;BR /&gt;
great job this works perfekt for me.&lt;BR /&gt;
there was on typo "| sendemail to=$bcc$" it must be | sendemail to=$cc_all$&lt;BR /&gt;
what exactly means "map maxsearches=PutAnIntegerNumberHere search="| gentimes start=-1 "&lt;/P&gt;

&lt;P&gt;could you please explain one more?&lt;BR /&gt;
Thanks a lot&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 07:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246926#M4907</guid>
      <dc:creator>ThomasControlw1</dc:creator>
      <dc:date>2016-05-13T07:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Splunk sendemail command to send multiple emails based on search results 2016</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246927#M4908</link>
      <description>&lt;P&gt;Hi somesoni2,&lt;BR /&gt;
great JOB! &lt;BR /&gt;
thre was on typo, "| sendemail to=$cc_all$" and it will work perfectly.&lt;BR /&gt;
could you please explaine on more detail what " | map maxsearches=PutAnIntegerNumberHere search="| gentimes start=-1 |" means?&lt;/P&gt;

&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 07:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/246927#M4908</guid>
      <dc:creator>ThomasControlw1</dc:creator>
      <dc:date>2016-05-13T07:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Splunk sendemail command to send multiple emails based on search results 2016</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/557756#M9258</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$ and select trigger "for each result". Email will be send to the respective email address for each line of result.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 07:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/557756#M9258</guid>
      <dc:creator>sirajnp</dc:creator>
      <dc:date>2021-06-30T07:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Splunk sendemail command to send multiple emails based on search results 2016</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/557764#M9262</link>
      <description>&lt;P&gt;It's pretty simple. 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:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-get-Splunk-sendemail-command-to-send-multiple-emails/m-p/557764#M9262</guid>
      <dc:creator>sirajnp</dc:creator>
      <dc:date>2021-06-30T07:39:34Z</dc:date>
    </item>
  </channel>
</rss>

