<?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 mail alert not functioning properly in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/mail-alert-not-functioning-properly/m-p/462161#M8208</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I made an alert which sends out mail to the respective teams whenever a high priority task has not been updated for more than an hour. The query is as follows:-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;index="abc" INC* main_metric,

state="New" OR state="In Progress" OR state="Awaiting Third Party" OR state="Pending" priority = "1 - Critical" OR priority = "2 - High"

| rex field=_raw "main_metric=\"(?&amp;lt;main_metric&amp;gt;\S+\s\d+\:\d+\:\d+)\""

| dedup main_metric

| dedup number

| eval main_metric = upper(main_metric) 

| lookup lookup_inactivity_alert_distribution_list.csv assignment_group OUTPUT "Email_To" "Email_Cc" "Email_Bcc" "Enabled" 

| fillnull value=0

| search number != 0 AND Enabled = "Y" AND main_metric != 0

| eval end=strptime(main_metric, "%Y-%m-%d %H:%M:%S.%N")

| eval start=now()

| eval diff = start - end  

| lookup lookup_frequency_impact.csv impact output "Frequency1" "Frequency2" "Frequency3" "Frequency4" 

| eval freqdiff1 = Frequency1 + 600

| eval freqdiff2 = Frequency2 + 600

| eval freqdiff3 = Frequency3 + 600

| eval freqdiff4 = Frequency4 + 600

|eval result = case('caller_id' = "SCOM System" AND

'diff' &amp;gt;= 'Frequency3' AND  

'diff' &amp;lt;= 'freqdiff3',"outcome1",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency1' AND

'diff' &amp;lt;= 'freqdiff1',"ouitcome2",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency2' AND

'diff' &amp;lt;= 'freqdiff2',"outcome3",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency3' AND

'diff' &amp;lt;= 'freqdiff3',"outcome4",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency4' AND

'diff' &amp;lt;= 'freqdiff4',"outcome5",1==1,"no outcome")

| search result="outcome1" OR result="outcome2" OR result="outcome3" OR result="outcome4" OR result="outcome5" AND state!="Closed"

| table  main_metric priority caller_id result assignment_group u_updated_on "Email_To" Email_Cc Email_Bcc number start end diff Frequency1 Frequency2 Frequency3 Frequency4

| map alert_main_metric_mail assignment_group="$assignment_group$" to="$Email_To$" cc="$Email_cc$" bcc="$Email_Bcc$"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second lookup handles the frequency with which the alert emails are to be sent with respect to the priority of the ticket. Now the problem that I am having is that if the ticket or task is closed within half an hour of it being created, the alert is still generated. Even if the ticket is de-escalated, the alert is still being received. I tried many modifications in the code but nothing seems to work. Could you all help me with this bug?&lt;/P&gt;
&lt;P&gt;P.S.: The map commands connect just the saved search which sends out the emails with the appropriate subject and description.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2020 16:23:05 GMT</pubDate>
    <dc:creator>ayushmaan_22</dc:creator>
    <dc:date>2020-06-09T16:23:05Z</dc:date>
    <item>
      <title>mail alert not functioning properly</title>
      <link>https://community.splunk.com/t5/Alerting/mail-alert-not-functioning-properly/m-p/462161#M8208</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I made an alert which sends out mail to the respective teams whenever a high priority task has not been updated for more than an hour. The query is as follows:-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;index="abc" INC* main_metric,

state="New" OR state="In Progress" OR state="Awaiting Third Party" OR state="Pending" priority = "1 - Critical" OR priority = "2 - High"

| rex field=_raw "main_metric=\"(?&amp;lt;main_metric&amp;gt;\S+\s\d+\:\d+\:\d+)\""

| dedup main_metric

| dedup number

| eval main_metric = upper(main_metric) 

| lookup lookup_inactivity_alert_distribution_list.csv assignment_group OUTPUT "Email_To" "Email_Cc" "Email_Bcc" "Enabled" 

| fillnull value=0

| search number != 0 AND Enabled = "Y" AND main_metric != 0

| eval end=strptime(main_metric, "%Y-%m-%d %H:%M:%S.%N")

| eval start=now()

| eval diff = start - end  

| lookup lookup_frequency_impact.csv impact output "Frequency1" "Frequency2" "Frequency3" "Frequency4" 

| eval freqdiff1 = Frequency1 + 600

| eval freqdiff2 = Frequency2 + 600

| eval freqdiff3 = Frequency3 + 600

| eval freqdiff4 = Frequency4 + 600

|eval result = case('caller_id' = "SCOM System" AND

'diff' &amp;gt;= 'Frequency3' AND  

'diff' &amp;lt;= 'freqdiff3',"outcome1",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency1' AND

'diff' &amp;lt;= 'freqdiff1',"ouitcome2",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency2' AND

'diff' &amp;lt;= 'freqdiff2',"outcome3",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency3' AND

'diff' &amp;lt;= 'freqdiff3',"outcome4",'caller_id' != "SCOM System" AND 'diff' &amp;gt;= 'Frequency4' AND

'diff' &amp;lt;= 'freqdiff4',"outcome5",1==1,"no outcome")

| search result="outcome1" OR result="outcome2" OR result="outcome3" OR result="outcome4" OR result="outcome5" AND state!="Closed"

| table  main_metric priority caller_id result assignment_group u_updated_on "Email_To" Email_Cc Email_Bcc number start end diff Frequency1 Frequency2 Frequency3 Frequency4

| map alert_main_metric_mail assignment_group="$assignment_group$" to="$Email_To$" cc="$Email_cc$" bcc="$Email_Bcc$"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second lookup handles the frequency with which the alert emails are to be sent with respect to the priority of the ticket. Now the problem that I am having is that if the ticket or task is closed within half an hour of it being created, the alert is still generated. Even if the ticket is de-escalated, the alert is still being received. I tried many modifications in the code but nothing seems to work. Could you all help me with this bug?&lt;/P&gt;
&lt;P&gt;P.S.: The map commands connect just the saved search which sends out the emails with the appropriate subject and description.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 16:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/mail-alert-not-functioning-properly/m-p/462161#M8208</guid>
      <dc:creator>ayushmaan_22</dc:creator>
      <dc:date>2020-06-09T16:23:05Z</dc:date>
    </item>
  </channel>
</rss>

