<?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: Structuring nested data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Structuring-nested-data/m-p/17500#M2272</link>
    <description>&lt;P&gt;There isn't any concept of nested table in splunk?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Feb 2013 05:52:45 GMT</pubDate>
    <dc:creator>smolcj</dc:creator>
    <dc:date>2013-02-25T05:52:45Z</dc:date>
    <item>
      <title>Structuring nested data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Structuring-nested-data/m-p/17498#M2270</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have an application that needs to write some data that may be several levels deep and I'm struggling to understand how I can best represent it for Splunk.&lt;/P&gt;

&lt;P&gt;Here's an example of a data set. It consists of:&lt;/P&gt;

&lt;P&gt;DeviceID=nnnnn&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Application=App1

    Permissions=X,Y,Z

Application=App2

    Permissions=Y,Z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In other words, a device may have multiple applications and each app may have multiple permissions. If I wanted to write a report that list all applications that contain Permission=X, how do you recommend we model the data?&lt;/P&gt;

&lt;P&gt;Any guidance you can provide will be greatly appreciated! &lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2010 11:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Structuring-nested-data/m-p/17498#M2270</guid>
      <dc:creator>Tim</dc:creator>
      <dc:date>2010-07-16T11:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Structuring nested data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Structuring-nested-data/m-p/17499#M2271</link>
      <description>&lt;P&gt;Easiest by far is to denormalize each fact (i.e., permission or set of permissions) into a self-contained and fully-qualifed distinct record, e.g. (each line below is a separate event/record):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DeviceID=nnnn,Application=App1,Permission=X
DeviceID=nnnn,Application=App1,Permission=Y
DeviceID=nnnn,Application=App1,Permission=Z
DeviceID=nnnn,Application=App2,Permission=Y
DeviceID=nnnn,Application=App2,Permission=Z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The Splunk query for applications containing permission X would be &lt;CODE&gt;Permission=X | stats count by Application&lt;/CODE&gt; (which would give you the count for each application as well, which you could discard.)&lt;/P&gt;

&lt;P&gt;You could compact it up one level, though for some reporting purposes you may wind up expanding that one level out to the equivalent of the above at search time (in the specific case of this report, though &lt;CODE&gt;Permission=X | stats count by Application&lt;/CODE&gt; will still work the same):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DeviceID=nnnn,Application=App1,Permission=X,Permission=Y,Permission=Z
DeviceID=nnnn,Application=App2,Permission=Y,Permission=Z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, btw, that while the raw forms suggested here look much larger than a tree, the indexed and compressed data set (which is how it would be stored on disk by Splunk) for large sets of data is &lt;EM&gt;not&lt;/EM&gt; larger than if it were represented as a tree or a more normalized form.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2010 12:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Structuring-nested-data/m-p/17499#M2271</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-07-16T12:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Structuring nested data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Structuring-nested-data/m-p/17500#M2272</link>
      <description>&lt;P&gt;There isn't any concept of nested table in splunk?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2013 05:52:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Structuring-nested-data/m-p/17500#M2272</guid>
      <dc:creator>smolcj</dc:creator>
      <dc:date>2013-02-25T05:52:45Z</dc:date>
    </item>
  </channel>
</rss>

