<?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 I get some missing parameters from JSON payload to a script for a custom alert app? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-do-I-get-some-missing-parameters-from-JSON-payload-to-a/m-p/266933#M4905</link>
    <description>&lt;P&gt;Firstly I am very new to Splunk app development. I'm trying to create a custom alert application and I'm having problems with getting some of the info on the detected condition from the json payload available to the script.&lt;/P&gt;

&lt;P&gt;If I was using a regular script action, I would have access to the following arguments passed to the script:&lt;/P&gt;

&lt;P&gt;0 = Script name&lt;BR /&gt;
 1 = Number of events returned&lt;BR /&gt;
 2 = Search terms&lt;BR /&gt;
 3 = Fully qualified query string&lt;BR /&gt;
 4 = Name of report&lt;BR /&gt;
 5 = Trigger reason (i.e. "The number of events was greater than 1")&lt;BR /&gt;
 6 = Browser URL to view the report&lt;BR /&gt;
 7 = This option has been deprecated and is no longer used&lt;BR /&gt;
 8 = File where the results for this search are stored (contains raw results)&lt;/P&gt;

&lt;P&gt;When using a custom alert app, these don't seem to apply and you get the data via reading stdin. I am using the json format and some of the above are in fact included in the json payload, however, I don't see any key that relates to trigger reason or number of events returned.&lt;/P&gt;

&lt;P&gt;How do I get access to those two specific pieces of information from the script being invoked from the custom alert app?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2016 18:05:15 GMT</pubDate>
    <dc:creator>isfleming</dc:creator>
    <dc:date>2016-03-31T18:05:15Z</dc:date>
    <item>
      <title>How do I get some missing parameters from JSON payload to a script for a custom alert app?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-get-some-missing-parameters-from-JSON-payload-to-a/m-p/266933#M4905</link>
      <description>&lt;P&gt;Firstly I am very new to Splunk app development. I'm trying to create a custom alert application and I'm having problems with getting some of the info on the detected condition from the json payload available to the script.&lt;/P&gt;

&lt;P&gt;If I was using a regular script action, I would have access to the following arguments passed to the script:&lt;/P&gt;

&lt;P&gt;0 = Script name&lt;BR /&gt;
 1 = Number of events returned&lt;BR /&gt;
 2 = Search terms&lt;BR /&gt;
 3 = Fully qualified query string&lt;BR /&gt;
 4 = Name of report&lt;BR /&gt;
 5 = Trigger reason (i.e. "The number of events was greater than 1")&lt;BR /&gt;
 6 = Browser URL to view the report&lt;BR /&gt;
 7 = This option has been deprecated and is no longer used&lt;BR /&gt;
 8 = File where the results for this search are stored (contains raw results)&lt;/P&gt;

&lt;P&gt;When using a custom alert app, these don't seem to apply and you get the data via reading stdin. I am using the json format and some of the above are in fact included in the json payload, however, I don't see any key that relates to trigger reason or number of events returned.&lt;/P&gt;

&lt;P&gt;How do I get access to those two specific pieces of information from the script being invoked from the custom alert app?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 18:05:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-get-some-missing-parameters-from-JSON-payload-to-a/m-p/266933#M4905</guid>
      <dc:creator>isfleming</dc:creator>
      <dc:date>2016-03-31T18:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get some missing parameters from JSON payload to a script for a custom alert app?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-get-some-missing-parameters-from-JSON-payload-to-a/m-p/266934#M4906</link>
      <description>&lt;P&gt;Many thanks to Siegfried Puchbauer @ziegfried for the following...&lt;/P&gt;

&lt;P&gt;For simple trigger conditions:&lt;BR /&gt;
• $counttype$ type selected in the dropdown - eg. “number of events”&lt;BR /&gt;
• $relation$ comparator selected in the dropdown - eg. “greater than”&lt;BR /&gt;
• $quantity$ the numeric threshold - eg. “1000”&lt;/P&gt;

&lt;P&gt;If a custom trigger condition was specified you can use $alert_condition$, which will contain the SPL-based trigger condition.&lt;/P&gt;

&lt;P&gt;It would be reasonable to create a custom param in alert_actions.conf to pass this information to your alert script&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 19:00:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-get-some-missing-parameters-from-JSON-payload-to-a/m-p/266934#M4906</guid>
      <dc:creator>isfleming</dc:creator>
      <dc:date>2016-04-08T19:00:15Z</dc:date>
    </item>
  </channel>
</rss>

