<?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 can i split a json array in mutiple events? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234611#M45709</link>
    <description>&lt;P&gt;Do you see any issues with ingesting this json array (which also has non-array element (timestamp)) as full event in Splunk? Splunk will convert this json array values to multivalued field and you should be able to report on them easily.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2016 17:53:47 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-03-07T17:53:47Z</dc:date>
    <item>
      <title>How can i split a json array in mutiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234610#M45708</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;Im trying to split a json Array into multiple Events in the props.conf&lt;BR /&gt;
Whats the best way to do this? &lt;/P&gt;

&lt;P&gt;Here is the json example:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
    "Applications":  [&lt;BR /&gt;
                         {&lt;BR /&gt;
                             "outputname":  "Adobe Flash Player",&lt;BR /&gt;
                             "version":  "19.0.0.185",&lt;BR /&gt;
                         },&lt;BR /&gt;
                         {&lt;BR /&gt;
                             "outputname":  "Adobe Reader",&lt;BR /&gt;
                             "version":  "1.2.3"&lt;BR /&gt;
                         },&lt;BR /&gt;
                         {&lt;BR /&gt;
                             "outputname":  "Attachmate Reflection X",&lt;BR /&gt;
                             "version":  "14.1.1217",&lt;BR /&gt;
                         }&lt;BR /&gt;
                     ],&lt;BR /&gt;
    "TIMESTAMP":  "2016-03-07 09:03:43"&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;What should the props.conf look like to split such a file?&lt;BR /&gt;
thank you for your suggestions.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 10:50:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234610#M45708</guid>
      <dc:creator>Outek</dc:creator>
      <dc:date>2016-03-07T10:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can i split a json array in mutiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234611#M45709</link>
      <description>&lt;P&gt;Do you see any issues with ingesting this json array (which also has non-array element (timestamp)) as full event in Splunk? Splunk will convert this json array values to multivalued field and you should be able to report on them easily.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 17:53:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234611#M45709</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-07T17:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can i split a json array in mutiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234612#M45710</link>
      <description>&lt;P&gt;There is no props.conf that will split that correctly into other JSON objects. You will need to pre-process with a script or modular input to achieve that. &lt;/P&gt;

&lt;P&gt;However, there is a search hack you can do to make reports on the data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your_search&amp;gt; | rename Applications{}.* as * | eval z = mvzip(outputname, version) | mvexpand z | eval z = split(z, ",") | eval outputname=mvindex(z,0), version = mvindex(z,1) | stats count by outputname, version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will allow you to make reports based on the current JSON event.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 18:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234612#M45710</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2016-03-07T18:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can i split a json array in mutiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234613#M45711</link>
      <description>&lt;P&gt;I know the way with mvzip/mvexpand, but i thought that there is an easier way. We did some tests with SEDCMD in the props.conf, but im not really satisfied with the results&lt;/P&gt;

&lt;P&gt;What do you mean with "pre-process with a script or modular input to achieve that" ?&lt;BR /&gt;
Should i rewrite the script which is writing the json file to only log each arrayline as single Event?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 19:34:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234613#M45711</guid>
      <dc:creator>Outek</dc:creator>
      <dc:date>2016-03-07T19:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can i split a json array in mutiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234614#M45712</link>
      <description>&lt;P&gt;Yes, If you have a script writing out that JSON object, put each item in it's own line.  You can put them all in the same file, but Splunk will read them in as individual events.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ "TIMESTAMP":"2016-03-07 09:03:43", "outputname": "Attachmate Reflection X", "version": "14.1.1217" }
{ "TIMESTAMP":"2016-03-07 09:03:43", "outputname": "Adobe Reader", "version": "1.2.3" }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Mar 2016 19:39:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234614#M45712</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2016-03-07T19:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can i split a json array in mutiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234615#M45713</link>
      <description>&lt;P&gt;I like this approach, i'll give it a try.. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 19:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-i-split-a-json-array-in-mutiple-events/m-p/234615#M45713</guid>
      <dc:creator>Outek</dc:creator>
      <dc:date>2016-03-07T19:45:09Z</dc:date>
    </item>
  </channel>
</rss>

