<?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 troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172935#M2832</link>
    <description>&lt;P&gt;I came across this search from Martin_Mueller  &lt;CODE&gt;index=_internal sourcetype=scheduler alert_actions=*email*&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This doesn't tell me much or if the report was actually emailed&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:08:33 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2020-09-28T19:08:33Z</dc:date>
    <item>
      <title>How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172934#M2831</link>
      <description>&lt;P&gt;I have my search head set up to send email alerts and reports.  I am getting some alerts, but after upgrading to Splunk 6.2, some of my alerts are not working and I cannot seem to get new reports working.&lt;/P&gt;

&lt;P&gt;Where can I go to see what the problem is with the emailing of the reports and alerts?&lt;/P&gt;

&lt;P&gt;I can see the report after it runs, but it just never shows up in the email.&lt;/P&gt;

&lt;P&gt;I am getting some alerts and reports in email.&lt;/P&gt;

&lt;P&gt;I even tried to set up new reports and alerts after running successful searches, but still no report for some new reports while others are successful.&lt;/P&gt;

&lt;P&gt;I just need to know were to look to find out if it is a syntax issue or if it is being blocked somehow at the email server.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 19:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172934#M2831</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2015-03-09T19:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172935#M2832</link>
      <description>&lt;P&gt;I came across this search from Martin_Mueller  &lt;CODE&gt;index=_internal sourcetype=scheduler alert_actions=*email*&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This doesn't tell me much or if the report was actually emailed&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:08:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172935#M2832</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2020-09-28T19:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172936#M2833</link>
      <description>&lt;P&gt;to help troubleshoot ... i would create the report then "| sendemail to=&lt;A href="mailto:blah@hotmail.com" target="_blank"&gt;blah@hotmail.com&lt;/A&gt;"&lt;BR /&gt;
you will see any errors in mail config there. It won't tell you if its being blocked, but if it completes without error. recently, i have seen the requirement for a host fqdn in $splunk_home/etc/system/local/alert_actions.conf&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:08:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172936#M2833</guid>
      <dc:creator>paulstark</dc:creator>
      <dc:date>2020-09-28T19:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172937#M2834</link>
      <description>&lt;P&gt;Thanks for the help Paul,&lt;/P&gt;

&lt;P&gt;Sorry for the slow responce:&lt;/P&gt;

&lt;P&gt;This is what I did:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=MyIndex Source=MySource | Stats Count By Source, Destination, Policy | sort Source, Destination, Policy  | sendmail to=My.Address@MyDomain.com&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This did not run, and errored out with "Unknown search command 'sendmail'.&lt;BR /&gt;
ssooo, I am guessing that this is not what you meant for me to try.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2015 20:13:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172937#M2834</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2015-03-18T20:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172938#M2835</link>
      <description>&lt;P&gt;build your query then "| sendemail to=&lt;A href="mailto:me@domain.com"&gt;me@domain.com&lt;/A&gt;" .... &lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2015 20:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172938#M2835</guid>
      <dc:creator>paulstark</dc:creator>
      <dc:date>2015-03-18T20:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172939#M2836</link>
      <description>&lt;P&gt;If you read Paul's search the final command in the search is sendemail and not sendmail as you have used. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2015 20:45:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172939#M2836</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2015-03-18T20:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172940#M2837</link>
      <description>&lt;P&gt;Thanks @paulstark and @davebrooking for helping,&lt;/P&gt;

&lt;P&gt;I got this search from support:&lt;BR /&gt;
&lt;CODE&gt;index="firewall" source_zone_name="*" destination_zone_name="*"&lt;BR /&gt;
policy_name="*" | stats count by "source_zone_name",&lt;BR /&gt;
"destination_zone_name", "policy_name" | sort "source_zone_name",&lt;BR /&gt;
"destination_zone_name", "policy_name"| sendemail&lt;BR /&gt;
to=hartfoml@mydomain.com server=mrelay.mydomain.com subject="Here is an&lt;BR /&gt;
email from Splunk SH1" message="This is an example message"&lt;BR /&gt;
sendresults=true inline=true format=raw sendpdf=true&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This search did send an email with an attachment BUT when I changed the end to &lt;CODE&gt;sendcsv=true&lt;/CODE&gt; /i did not get the email&lt;/P&gt;

&lt;P&gt;I sent a new Diag to support and have not heard back.  I am getting python errors that read &lt;CODE&gt;ERROR  sendemail:1213 - local variable 'filename' referenced before assignment&lt;/CODE&gt; at the time that the email is suppose to have been sent.&lt;/P&gt;

&lt;P&gt;Thanks again for helping&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 15:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172940#M2837</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2015-03-24T15:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why I am not receiving emails for some scheduled alerts and reports after upgrading to Splunk 6.2?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172941#M2838</link>
      <description>&lt;P&gt;So here is the answer that I got while working with support;&lt;/P&gt;

&lt;P&gt;Use this search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Your_search Foo=*  | stats count by "foo" | sort "foo"| sendemail to=yourname@yourdomain.com server=mail_relay.yourdomain.com subject="Here is an email from Splunk SearchHead" message="This is an example message" sendresults=true inline=true format=raw sendpdf=true&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Change sendprf to sendcsv or change true to false to see what is working and what is not.&lt;/P&gt;

&lt;P&gt;In my case everything but CSV attachment was working.  this lead support to look at the sendmail.py and why all other functions were working and not send mail.&lt;/P&gt;

&lt;P&gt;I had added a datestamp variable to be added to the csv file name like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;# create datestamp for filename&lt;BR /&gt;
    datestamp = time.strftime('%Y-%m-%d')&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I don't remember where I got this Mod but it came with this line also&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;# strip control characters, forward &amp;amp; backslash&lt;BR /&gt;
    filename = re.sub(r'[\x00-\x1f\x7f/\\]+', '-', filename)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The I changed this line in the sendmail.py file in $splunkhome/etc/apps/search/bin/&lt;BR /&gt;
from: &lt;CODE&gt;csvAttachment.add_header('Content-Disposition', 'attachment', filename="splunk-results.csv")&lt;/CODE&gt;&lt;BR /&gt;
to: &lt;CODE&gt;csvAttachment.add_header('Content-Disposition', 'attachment', filename = '%s-%s.csv' % (subject, datestamp))&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Support was able to see that the filename= was referenced in the "# strip control caterers" before it was referenced in the "csvAttachment.add_header"&lt;BR /&gt;&lt;BR /&gt;
I commented out the line &lt;CODE&gt;filename = re.sub(r'[\x00-\x1f\x7f/\\]+', '-', filename)&lt;/CODE&gt; and attachments started working again.&lt;/P&gt;

&lt;P&gt;At some time in the future I will test taking out control characters but for now it is working.&lt;/P&gt;

&lt;P&gt;use the email test above to test email functions when editing custom sendmail.py configurations&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-troubleshoot-why-I-am-not-receiving-emails-for-some/m-p/172941#M2838</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2015-03-26T14:26:08Z</dc:date>
    </item>
  </channel>
</rss>

