<?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 run a nested loop? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545803#M90957</link>
    <description>&lt;P&gt;I am not sure you can easily get the representation you are showing, however,&amp;nbsp; you could try something like this to break up the data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath path=Dept_details output=Dept_details
| mvexpand Dept_details
| spath input=Dept_details&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 29 Mar 2021 05:54:35 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-03-29T05:54:35Z</dc:date>
    <item>
      <title>How to run a nested loop?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545796#M90956</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have one field containing an array within an array.&lt;/P&gt;&lt;P&gt;How can I run a for loop to query the nested arrays and display them?&lt;/P&gt;&lt;P&gt;Eg :-&lt;/P&gt;&lt;P&gt;Dept_details : [&lt;/P&gt;&lt;P&gt;{name:"cse", HOD:"somename", students:[&lt;/P&gt;&lt;P&gt;{name:"aditya", rollNo:"1"}, {name:"akash", rollNo="2"}&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;name:"ece", HOD:"somename2", students:[&lt;/P&gt;&lt;P&gt;{name:"abhiram", rollNo:"1"}, {name:"abhay", rollNo="2"}&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I expect the results to be like this :-&lt;/P&gt;&lt;P&gt;Dept_details&lt;/P&gt;&lt;P&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hod&lt;/P&gt;&lt;P&gt;cse&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; someone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;student details&lt;/P&gt;&lt;P&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rollNo&lt;/P&gt;&lt;P&gt;aditya&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;akash&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dept details&lt;/P&gt;&lt;P&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hod&lt;/P&gt;&lt;P&gt;ise&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; someone2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;student details&lt;/P&gt;&lt;P&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rollNo&lt;/P&gt;&lt;P&gt;abhiram&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;abhay&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 04:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545796#M90956</guid>
      <dc:creator>aditya</dc:creator>
      <dc:date>2021-03-29T04:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to run a nested loop?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545803#M90957</link>
      <description>&lt;P&gt;I am not sure you can easily get the representation you are showing, however,&amp;nbsp; you could try something like this to break up the data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath path=Dept_details output=Dept_details
| mvexpand Dept_details
| spath input=Dept_details&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:54:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545803#M90957</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-29T05:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to run a nested loop?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545810#M90958</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The events which are getting logged for my project can have same id. So, on running mvexpand, it lists the contents of all array of all events. That's why I need to run a for loop somehow. Otherwise I can't calculate no of depts in dept_details.&lt;/P&gt;&lt;P&gt;Can you help with this?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 06:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545810#M90958</guid>
      <dc:creator>aditya</dc:creator>
      <dc:date>2021-03-29T06:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to run a nested loop?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545814#M90959</link>
      <description>&lt;P&gt;I am not sure where id is coming from since it isn't in the example you shared - if you need the count of dept_details&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath path=Dept_details output=Dept_details
| eval Dep_t_count=mvcount(Dept_details)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Mar 2021 06:19:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545814#M90959</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-29T06:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to run a nested loop?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545830#M90960</link>
      <description>&lt;P&gt;Ok, got it. Thanks for your help!!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 09:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-nested-loop/m-p/545830#M90960</guid>
      <dc:creator>aditya</dc:creator>
      <dc:date>2021-03-29T09:59:30Z</dc:date>
    </item>
  </channel>
</rss>

