<?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 How do you alert output and result variables? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-do-you-alert-output-and-result-variables/m-p/386197#M6778</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have the following search in my alert:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mlbso sourcetype=BWP_hanatraces "long running cursor detected" AND "CANCEL REQUESTED"  
| eval DBSID="TEST" 
| rex field=IDLE_TIME "(?&amp;lt;idletime&amp;gt;\d+) sec" 
| eventstats max(idletime) as MAX_IDLE_TIME 
| eval MAX_IDLE_TIME =tostring(MAX_IDLE_TIME ,"duration")
| lookup email_groups.csv DBSID OUTPUT email_recipients AS email_recipients
| sort - IDLE_TIME
| table _time DBSID CONNECTION_ID CONNECTION_STATUS IDLE_TIME MAX_IDLE_TIME HOST email_recipients
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I would like to use the following fields in my alert subject and e-mail recipient list:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$result.DBSID$
$result.MAX_IDLE_TIME$
$result.email_recipients$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With the above search it works fine, but what is not nice is that, in the result table also the long list of the e-mail addresses appears. However when I delete it from the table command, then the corresponding variable (email_recipients) does not get transferred to the alert and e-mail is not sent / does not reach the recipients.&lt;/P&gt;

&lt;P&gt;How would I transfer the email_recipients to the alert $result.email_recipients$ of the alert, but does not show it in the output itself?&lt;/P&gt;

&lt;P&gt;Is it possible?&lt;/P&gt;

&lt;P&gt;Kind Regards,&lt;BR /&gt;
Kamil&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:55:01 GMT</pubDate>
    <dc:creator>damucka</dc:creator>
    <dc:date>2020-09-29T23:55:01Z</dc:date>
    <item>
      <title>How do you alert output and result variables?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-alert-output-and-result-variables/m-p/386197#M6778</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have the following search in my alert:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mlbso sourcetype=BWP_hanatraces "long running cursor detected" AND "CANCEL REQUESTED"  
| eval DBSID="TEST" 
| rex field=IDLE_TIME "(?&amp;lt;idletime&amp;gt;\d+) sec" 
| eventstats max(idletime) as MAX_IDLE_TIME 
| eval MAX_IDLE_TIME =tostring(MAX_IDLE_TIME ,"duration")
| lookup email_groups.csv DBSID OUTPUT email_recipients AS email_recipients
| sort - IDLE_TIME
| table _time DBSID CONNECTION_ID CONNECTION_STATUS IDLE_TIME MAX_IDLE_TIME HOST email_recipients
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I would like to use the following fields in my alert subject and e-mail recipient list:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$result.DBSID$
$result.MAX_IDLE_TIME$
$result.email_recipients$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With the above search it works fine, but what is not nice is that, in the result table also the long list of the e-mail addresses appears. However when I delete it from the table command, then the corresponding variable (email_recipients) does not get transferred to the alert and e-mail is not sent / does not reach the recipients.&lt;/P&gt;

&lt;P&gt;How would I transfer the email_recipients to the alert $result.email_recipients$ of the alert, but does not show it in the output itself?&lt;/P&gt;

&lt;P&gt;Is it possible?&lt;/P&gt;

&lt;P&gt;Kind Regards,&lt;BR /&gt;
Kamil&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:55:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-alert-output-and-result-variables/m-p/386197#M6778</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2020-09-29T23:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you alert output and result variables?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-alert-output-and-result-variables/m-p/386198#M6779</link>
      <description>&lt;P&gt;Make the &lt;CODE&gt;email_recipients&lt;/CODE&gt; invisible like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename email_recipients AS _email_recipients
...  $result._email_recipients$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Apr 2019 03:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-alert-output-and-result-variables/m-p/386198#M6779</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-02T03:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do you alert output and result variables?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-alert-output-and-result-variables/m-p/386199#M6780</link>
      <description>&lt;P&gt;Perfect, thank you !!!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 07:54:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-alert-output-and-result-variables/m-p/386199#M6780</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2019-04-02T07:54:35Z</dc:date>
    </item>
  </channel>
</rss>

