<?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: Extracting data from nested json payload of varying size in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-data-from-nested-json-payload-of-varying-size/m-p/421999#M94432</link>
    <description>&lt;P&gt;Hi dhruv101,&lt;/P&gt;

&lt;P&gt;best thing to do here is to use &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; to get this captured:&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myTransform]
REGEX = (\w+):'([^']+)'
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mySourceType]
REPORT-myUniqueClassName = myTransform
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create new fields using the value before the &lt;CODE&gt;:&lt;/CODE&gt; and the actually value will be everything inside the single quoats.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jul 2018 01:02:40 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2018-07-06T01:02:40Z</dc:date>
    <item>
      <title>Extracting data from nested json payload of varying size</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-data-from-nested-json-payload-of-varying-size/m-p/421998#M94431</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have events coming into splunk with payload of nested json array type.&lt;BR /&gt;
The elements in the array are of the same format looking like - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
type:'Foo',
time:'10 July'
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But events may have variable number of these elements within the payload array. That means some event may have 10 elements within the payload array whereas some other may have just 1. Is there a way to efficiently handle extracting data from such variable size payloads in splunk? I saw some examples with spath but it looks like the expectation is to kinda have same fixed number of elements in the payload array.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 23:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-data-from-nested-json-payload-of-varying-size/m-p/421998#M94431</guid>
      <dc:creator>dhruv101</dc:creator>
      <dc:date>2018-07-05T23:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data from nested json payload of varying size</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-data-from-nested-json-payload-of-varying-size/m-p/421999#M94432</link>
      <description>&lt;P&gt;Hi dhruv101,&lt;/P&gt;

&lt;P&gt;best thing to do here is to use &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; to get this captured:&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myTransform]
REGEX = (\w+):'([^']+)'
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mySourceType]
REPORT-myUniqueClassName = myTransform
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create new fields using the value before the &lt;CODE&gt;:&lt;/CODE&gt; and the actually value will be everything inside the single quoats.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 01:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-data-from-nested-json-payload-of-varying-size/m-p/421999#M94432</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-07-06T01:02:40Z</dc:date>
    </item>
  </channel>
</rss>

