<?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 do I get the custom alert example from the Splunk Developers Guide v 2 to work? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-do-I-get-the-custom-alert-example-from-the-Splunk-Developers/m-p/202502#M3525</link>
    <description>&lt;P&gt;I posted the same question on stackexchange.com (&lt;A href="http://stackoverflow.com/a/37737994/2871638"&gt;http://stackoverflow.com/a/37737994/2871638&lt;/A&gt;) and the answer is that the script expects JSON input.  This is supposed to take the JSON input from the meh.com API and output JSON.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 19:16:17 GMT</pubDate>
    <dc:creator>michael_peters</dc:creator>
    <dc:date>2016-06-22T19:16:17Z</dc:date>
    <item>
      <title>How do I get the custom alert example from the Splunk Developers Guide v 2 to work?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-get-the-custom-alert-example-from-the-Splunk-Developers/m-p/202501#M3524</link>
      <description>&lt;P&gt;I am working through the Splunk Developers guide v 2 by Kyle Smith aka &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/3514"&gt;@alacercogitatus&lt;/a&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/users/3659/alacercogitatus.html" target="_blank"&gt;https://answers.splunk.com/users/3659/alacercogitatus.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I am having issues getting the custom alerting to work.&lt;/P&gt;

&lt;P&gt;In particular the caa_file_write.py file is throwing the following errors in _internal:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;06-09-2016 19:23:21.635 -0400 ERROR sendmodalert - action=file_write STDERR -    File "/opt/sdg/splunk/lib/python2.7/json/decoder.py", line 382, in raw_decode
host = SPLK-ET source = /opt/sdg/splunk/var/log/splunk/splunkd.log sourcetype = splunkd

06-09-2016 19:23:21.635 -0400 ERROR sendmodalert - action=file_write STDERR -    File "/opt/sdg/splunk/lib/python2.7/json/decoder.py", line 364, in decode
host = SPLK-ET source = /opt/sdg/splunk/var/log/splunk/splunkd.log sourcetype = splunkd

06-09-2016 19:23:21.635 -0400 ERROR sendmodalert - action=file_write STDERR -    File "/opt/sdg/splunk/lib/python2.7/json/__init__.py", line 339, in loads
host = SPLK-ET source = /opt/sdg/splunk/var/log/splunk/splunkd.log sourcetype = splunkd

06-09-2016 19:23:21.635 -0400 ERROR sendmodalert - action=file_write STDERR -    File "/opt/sdg/splunk/etc/apps/SDG/bin/caa_file_write.py", line 7, in 
host = SPLK-ET source = /opt/sdg/splunk/var/log/splunk/splunkd.log sourcetype = splunkd
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The file in question is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys, json, urllib2
def write_file(settings):
        f = open('myfile','w')
        f.write("%s"%json.dumps(settings))
        f.close()
if __name__ == "__main__":
        caa_config = json.loads(sys.stdin.read())
        write_file(caa_config)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-get-the-custom-alert-example-from-the-Splunk-Developers/m-p/202501#M3524</guid>
      <dc:creator>michael_peters</dc:creator>
      <dc:date>2020-09-29T09:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the custom alert example from the Splunk Developers Guide v 2 to work?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-get-the-custom-alert-example-from-the-Splunk-Developers/m-p/202502#M3525</link>
      <description>&lt;P&gt;I posted the same question on stackexchange.com (&lt;A href="http://stackoverflow.com/a/37737994/2871638"&gt;http://stackoverflow.com/a/37737994/2871638&lt;/A&gt;) and the answer is that the script expects JSON input.  This is supposed to take the JSON input from the meh.com API and output JSON.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 19:16:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-get-the-custom-alert-example-from-the-Splunk-Developers/m-p/202502#M3525</guid>
      <dc:creator>michael_peters</dc:creator>
      <dc:date>2016-06-22T19:16:17Z</dc:date>
    </item>
  </channel>
</rss>

