<?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 to create sample JSON data and display it in a tree structure? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744509#M241263</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Ah yes you do need access to the index you search but it can be any index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might actually be able to use the "windbag" command instead like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| windbag | head 1 | eval _raw="{\"name\":\"John Doe\",\"age\":30,\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"state\":\"CA\",\"zip\":\"12345\"},\"interests\":[\"reading\",\"hiking\",\"coding\"]}"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1745002354308.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38655i155A133ECFC2B52B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1745002354308.png" alt="livehybrid_0-1745002354308.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
    <pubDate>Fri, 18 Apr 2025 18:52:40 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-04-18T18:52:40Z</dc:date>
    <item>
      <title>How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744494#M241257</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;How to create sample JSON data and display it in tree structure?&lt;BR /&gt;I used makeresults to create sample JSON data below&lt;/P&gt;&lt;PRE&gt;| makeresults 
| &lt;SPAN class=""&gt;eval&lt;/SPAN&gt; data = &lt;SPAN class=""&gt;"{\"name\":\"John Doe\",\"age\":30,\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"state\":\"CA\",\"zip\":\"12345\"},\"interests\":[\"reading\",\"hiking\",\"coding\"]}"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The search result is below.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_0-1744991048233.png" style="width: 764px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38651iEE40BAD1D2A5D229/image-dimensions/764x128?v=v2" width="764" height="128" role="button" title="LearningGuy_0-1744991048233.png" alt="LearningGuy_0-1744991048233.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My expected output is below. I have the option to select "list" from the drop down, but this option is only available if I import the data to an index.&amp;nbsp; Please help. Thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_1-1744991429331.png" style="width: 504px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38652i3D507AD87CACB1FD/image-dimensions/504x291?v=v2" width="504" height="291" role="button" title="LearningGuy_1-1744991429331.png" alt="LearningGuy_1-1744991429331.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JSON data:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "name": "John Doe",
  "age": 30,
  "address": {
    "street": "123 Main St",
    "city": "Anytown",
    "state": "CA",
    "zip": "12345"
  },
  "interests": [
    "reading",
    "hiking",
    "coding"
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 16:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744494#M241257</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2025-04-18T16:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744496#M241258</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using makeresults which is a report-generating command you get a table output.&lt;/P&gt;&lt;P&gt;When I want to get a JSON tree view you need it to be an eventbased output, I use this little tricky to get an event and then override with eval _raw like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 | eval _raw="{\"name\":\"John Doe\",\"age\":30,\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"state\":\"CA\",\"zip\":\"12345\"},\"interests\":[\"reading\",\"hiking\",\"coding\"]}"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1744992323244.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38653i3B58F528656DD21E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1744992323244.png" alt="livehybrid_0-1744992323244.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 16:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744496#M241258</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-18T16:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744503#M241260</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If I literally used your query, I got no result, but if I changed the index name to one of my existing indexes, I got the same output.&lt;BR /&gt;1. Should I use one of my existing indexes for testing?&amp;nbsp; (As I am not an admin, I don't have the ability to import JSON and create an index)&lt;BR /&gt;2. How do I create a summary index in JSON format with a tree structure?&lt;BR /&gt;Thank you so much for your help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_0-1744996643935.png" style="width: 716px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38654iFB4E13E080BBE26C/image-dimensions/716x222?v=v2" width="716" height="222" role="button" title="LearningGuy_0-1744996643935.png" alt="LearningGuy_0-1744996643935.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 17:49:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744503#M241260</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2025-04-18T17:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744506#M241261</link>
      <description>&lt;P&gt;Not being admin, you might not have access to _internal which is why you get no events which you can override the _raw field. So, yes, try using one of the indexes you do have access to (with a corresponding timeframe so that you find at least 1 event).&lt;/P&gt;&lt;P&gt;Assuming you have access/permissions, you can add to a summary index with the collect command.&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Collect" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Collect&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 18:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744506#M241261</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-04-18T18:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744507#M241262</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Will a JSON format with a tree structure be supported if I create a summary index using a Splunk report?&lt;/STRONG&gt;&lt;BR /&gt;The Splunk report automatically generated&amp;nbsp; summary index using the "summaryindex" command , rather than&amp;nbsp; the "collect" command.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;According to the documentation you sent, using output_format=hec to get JSON-formatted output.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 18:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744507#M241262</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2025-04-18T18:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744509#M241263</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Ah yes you do need access to the index you search but it can be any index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might actually be able to use the "windbag" command instead like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| windbag | head 1 | eval _raw="{\"name\":\"John Doe\",\"age\":30,\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"state\":\"CA\",\"zip\":\"12345\"},\"interests\":[\"reading\",\"hiking\",\"coding\"]}"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1745002354308.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38655i155A133ECFC2B52B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1745002354308.png" alt="livehybrid_0-1745002354308.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 18:52:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744509#M241263</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-18T18:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744511#M241264</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes you can use output_mode=hec - see below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| windbag 
| head 1 
| eval _raw="{\"name\":\"John Doe\",\"age\":30,\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"state\":\"CA\",\"zip\":\"12345\"},\"interests\":[\"reading\",\"hiking\",\"coding\"]}" 
| eval source="answersDemo" 
| collect index=main output_format=hec&lt;/LI-CODE&gt;&lt;P&gt;Then when I search index=main source=answersDemo:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1745002797055.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38656iAF1537E7491C1A89/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1745002797055.png" alt="livehybrid_0-1745002797055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note - you need to ensure you have the run_collect capability for your role and also access to the index you are collecting in to.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 19:00:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744511#M241264</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-18T19:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sample JSON data and display it in a tree structure?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744515#M241265</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The windbag command worked just fine, but the collect command did not work.&lt;BR /&gt;&lt;STRONG&gt;How do I use collect command in the Splunk report that appended |summaryindex automatically?&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Perhaps screenshot below will explain better. Thank you for your help&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_2-1745004365541.png" style="width: 636px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38659i9B7F794576F36EF6/image-dimensions/636x132?v=v2" width="636" height="132" role="button" title="LearningGuy_2-1745004365541.png" alt="LearningGuy_2-1745004365541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have a Splunk report that generates summary index daily&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_0-1745003660305.png" style="width: 550px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38657i6ADEA0992FF1B50B/image-dimensions/550x186?v=v2" width="550" height="186" role="button" title="LearningGuy_0-1745003660305.png" alt="LearningGuy_0-1745003660305.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;STRONG&gt;The search query will be&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=summary      report=json_test&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;When the report run daily, the search will be appended with&lt;STRONG&gt; "| summary index"&lt;/STRONG&gt; command below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| windbag | head 1 | eval _raw="{\"name\":\"John Doe\",\"age\":30,\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"state\":\"CA\",\"zip\":\"12345\"},\"interests\":[\"reading\",\"hiking\",\"coding\"]}"

| summaryindex spool=t uselb=t addtime=t index="summary" file="RMD[random characters].stash_new" name="json_test" marker="hostname=\"https://aa.test.com/\",report=\"json_test\"&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_1-1745003727158.png" style="width: 566px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38658i5136A03AF878E962/image-dimensions/566x304?v=v2" width="566" height="304" role="button" title="LearningGuy_1-1745003727158.png" alt="LearningGuy_1-1745003727158.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 19:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-sample-JSON-data-and-display-it-in-a-tree/m-p/744515#M241265</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2025-04-18T19:28:46Z</dc:date>
    </item>
  </channel>
</rss>

