<?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 Splunk App for AWS: JSON formatting for AWS SNS alert in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-App-for-AWS-JSON-formatting-for-AWS-SNS-alert/m-p/311072#M37231</link>
    <description>&lt;P&gt;I need to pass JSON formatted data to the AWS SNS alert. &lt;BR /&gt;
What I have is a table. I created an SNS alert (save as alert-&amp;gt;choose AWS SNS)&lt;BR /&gt;
When sent through SNS alert the format is not JSON. &lt;BR /&gt;
How can I format this table in JSON?&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2017 10:41:14 GMT</pubDate>
    <dc:creator>sduchene_splunk</dc:creator>
    <dc:date>2017-08-31T10:41:14Z</dc:date>
    <item>
      <title>Splunk App for AWS: JSON formatting for AWS SNS alert</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-App-for-AWS-JSON-formatting-for-AWS-SNS-alert/m-p/311072#M37231</link>
      <description>&lt;P&gt;I need to pass JSON formatted data to the AWS SNS alert. &lt;BR /&gt;
What I have is a table. I created an SNS alert (save as alert-&amp;gt;choose AWS SNS)&lt;BR /&gt;
When sent through SNS alert the format is not JSON. &lt;BR /&gt;
How can I format this table in JSON?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 10:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-App-for-AWS-JSON-formatting-for-AWS-SNS-alert/m-p/311072#M37231</guid>
      <dc:creator>sduchene_splunk</dc:creator>
      <dc:date>2017-08-31T10:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk App for AWS: JSON formatting for AWS SNS alert</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-App-for-AWS-JSON-formatting-for-AWS-SNS-alert/m-p/311073#M37232</link>
      <description>&lt;P&gt;idea 1 : use the json tool app &lt;A href="https://splunkbase.splunk.com/app/3540/"&gt;https://splunkbase.splunk.com/app/3540/&lt;/A&gt; (note, i haven't tried it, but seems to do the job)&lt;BR /&gt;
idea 2 : use SPL to create a new field containing the entire line into JSON format, and pass this field to sns alert&lt;/P&gt;

&lt;H2&gt;this uses foreach command,&lt;/H2&gt;

&lt;P&gt;index=xx&lt;BR /&gt;
| eval message="{"&lt;BR /&gt;
| foreach *&lt;BR /&gt;
    [eval message=if("&amp;lt;&lt;FIELD&gt;&amp;gt;"="message", message, message. " \"". "&amp;lt;&lt;FIELD&gt;&amp;gt;" . "\" : \"".&amp;lt;&lt;FIELD&gt;&amp;gt;."\", ")]&lt;BR /&gt;
| eval message=rtrim(message, " ,")| eval message=message." }"&lt;/FIELD&gt;&lt;/FIELD&gt;&lt;/FIELD&gt;&lt;/P&gt;

&lt;P&gt;--&lt;BR /&gt;
then finally pass the field message :  $result.message$ to sns alert&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 10:48:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-App-for-AWS-JSON-formatting-for-AWS-SNS-alert/m-p/311073#M37232</guid>
      <dc:creator>sduchene_splunk</dc:creator>
      <dc:date>2017-08-31T10:48:08Z</dc:date>
    </item>
  </channel>
</rss>

