<?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 Splunk email alert with variable email address and variable subject values. in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513613#M3001</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In my search query I've defined the 3 email_subjects and 3 email_addresses with eval to which I want to send an alert based on threshold defined.&lt;/P&gt;&lt;P&gt;e.g if threshold value is =1 then email_subject1 and email_address1 etc.&lt;/P&gt;&lt;P&gt;My output being in table format because of which&amp;nbsp;for availing $result.feildname$ values,&amp;nbsp; I'll have to add&amp;nbsp;email_subject and&amp;nbsp; email_address fields in search result table (definitely not desired) - that being the issue I'm stuck at, same issue I faced with "sendemail" as well.&lt;/P&gt;&lt;P&gt;Is there an alternate way to send email alert via splunk itself (no script)?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1378"&gt;@fk319&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/2012"&gt;@MuS&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/81823"&gt;@bmunson_splunk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2020 18:13:43 GMT</pubDate>
    <dc:creator>sahil2901</dc:creator>
    <dc:date>2020-08-11T18:13:43Z</dc:date>
    <item>
      <title>Sending Splunk email alert with variable email address and variable subject values.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513613#M3001</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In my search query I've defined the 3 email_subjects and 3 email_addresses with eval to which I want to send an alert based on threshold defined.&lt;/P&gt;&lt;P&gt;e.g if threshold value is =1 then email_subject1 and email_address1 etc.&lt;/P&gt;&lt;P&gt;My output being in table format because of which&amp;nbsp;for availing $result.feildname$ values,&amp;nbsp; I'll have to add&amp;nbsp;email_subject and&amp;nbsp; email_address fields in search result table (definitely not desired) - that being the issue I'm stuck at, same issue I faced with "sendemail" as well.&lt;/P&gt;&lt;P&gt;Is there an alternate way to send email alert via splunk itself (no script)?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1378"&gt;@fk319&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/2012"&gt;@MuS&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/81823"&gt;@bmunson_splunk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 18:13:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513613#M3001</guid>
      <dc:creator>sahil2901</dc:creator>
      <dc:date>2020-08-11T18:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sending Splunk email alert with variable email address and variable subject values.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513617#M3002</link>
      <description>&lt;P&gt;Can you share some example?&lt;/P&gt;&lt;P&gt;your question is not clear.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 18:34:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513617#M3002</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-11T18:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sending Splunk email alert with variable email address and variable subject values.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513618#M3003</link>
      <description>&lt;P&gt;The issue here is several commands are built as the search as parsed, sendemail is one of these commands.&lt;/P&gt;&lt;P&gt;There are three ways I have found around this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;call a saved search&lt;/LI&gt;&lt;LI&gt;use the map command&lt;/LI&gt;&lt;LI&gt;use a subsearch&lt;BR /&gt;|sendemail&lt;BR /&gt;&amp;nbsp; [ | makeresults&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | eval To="to@email.com"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | eval Subject=case(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a&amp;lt;th1,"Below Threshold 1",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a&amp;lt;th2,"Below Threshold 2",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; true(),"Above Threshold 3")&lt;BR /&gt;&amp;nbsp; ]&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Be forewarned the map command is broken in 8.0.2, but is fixed in 8.0.5&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 18:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513618#M3003</guid>
      <dc:creator>fk319</dc:creator>
      <dc:date>2020-08-11T18:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sending Splunk email alert with variable email address and variable subject values.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513624#M3004</link>
      <description>&lt;P&gt;There are 2 basic options.&lt;BR /&gt;&lt;BR /&gt;#1: Hide the fields that you are using by making them &lt;STRONG&gt;invisible&lt;/STRONG&gt;&amp;nbsp;by &lt;STRONG&gt;prepending&lt;/STRONG&gt; them with the &lt;STRONG&gt;underscore&lt;/STRONG&gt; ("_") character like this:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;... foreach&amp;nbsp;email_* [ rename &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; AS _&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; ]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&amp;nbsp;&lt;SPAN&gt;$result._feildname$&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;#2: Bring the email function into the &lt;STRONG&gt;SPL&lt;/STRONG&gt; using the &lt;STRONG&gt;sendemail&lt;/STRONG&gt; command and separate the 2 portions of data using the &lt;STRONG&gt;map&lt;/STRONG&gt; command to like this:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ... | outputlookup TEMP_FILE_FOR_ALERT_FOO_BAR_BAT_DELETE_ME_AT_ANY_TIME.csv&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | stats values(email_recipient) AS&amp;nbsp;email_recipients BY email_subject&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | nomv email_recipients&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | rex field=email_recipients mod=sed "s/[\r\n\s]/,/g"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; |&amp;nbsp; map max_searches=10 search="|inputlookup&amp;nbsp;TEMP_FILE_FOR_ALERT_FOO_BAR_BAT_DELETE_ME_AT_ANY_TIME.csv&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | search&amp;nbsp;email_subject=\"$email_subject$\"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | fields - email_*&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | sendemail to=\"$email_recipients$\" subject=\"$email_subject$\""&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 19:17:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Sending-Splunk-email-alert-with-variable-email-address-and/m-p/513624#M3004</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-08-11T19:17:09Z</dc:date>
    </item>
  </channel>
</rss>

