<?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 combine two JsonArray into a single column? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230103#M68205</link>
    <description>&lt;P&gt;Try the updated query&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2016 02:23:56 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-10-11T02:23:56Z</dc:date>
    <item>
      <title>How to combine two JsonArray into a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230099#M68201</link>
      <description>&lt;P&gt;HI!!! &lt;/P&gt;

&lt;P&gt;I am trying to combine two JsonArray  (Nextbus &amp;amp; SubsequentBus) to a single column. &lt;BR /&gt;
I managed to extract both JsonArray but unable to append.&lt;/P&gt;

&lt;P&gt;This is how my data looks like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Services: [ [-] 
     { [-] 
        NextBus: { [+] 
       } 
        Operator:  xxx 
        ServiceNo:  000
        SubsequentBus: { [+] 
       } 

     } 
     { [+] 
     } 
     { [+] 
     } 
     { [+] 
     } 
   ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is my search query : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | spath  path=Services{} 
 | rename Services{}.ServiceNo AS name , Services{}.Operator AS type, Services{}.NextBus{}.ArrivingTime As ar,  Services{}.SubsequentBus{}.ArrivingTime As est_arr
 | eval x=mvzip(name,mvzip(type,arr) ) | mvexpand x 
 | eval y=mvzip(name,mvzip(type,est_arr)) | mvexpand y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope to get advice. &lt;BR /&gt;
Thanks in advance! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 09:41:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230099#M68201</guid>
      <dc:creator>weiquanswq</dc:creator>
      <dc:date>2016-10-05T09:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two JsonArray into a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230100#M68202</link>
      <description>&lt;P&gt;If its about placing the value of NextBus().ArrivingTime and SubsequentBus.ArrivingTime in same column , following way to append values can be explored:&lt;/P&gt;

&lt;PRE&gt;
... | spath  path=Services{} 
| rename Services{}.ServiceNo AS name , Services{}.Operator AS type, Services{}.NextBus{}.ArrivingTime As ar,  Services{}.SubsequentBus{}.ArrivingTime As est_arr
| eval arrivalTime="NextBus  : ".ar."      SubsequentBus : ".est_arr 
| table name, type, arrivalTime
&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2016 04:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230100#M68202</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-10-10T04:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two JsonArray into a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230101#M68203</link>
      <description>&lt;P&gt;Try this..&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;UPDATED&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | spath  path=Services{} 
| rename Services{}.ServiceNo AS name , Services{}.Operator AS type, Services{}.NextBus{}.ArrivingTime As ar,  Services{}.SubsequentBus{}.ArrivingTime As est_arr
| eval x=mvzip(name,mvzip(type, mvzip(arr, est_arr)) ) 
| mvexpand x 
| table name type arr est_arr
| untable name type arrival_times
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2016 04:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230101#M68203</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-10T04:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two JsonArray into a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230102#M68204</link>
      <description>&lt;P&gt;Sundareshr, &lt;BR /&gt;
I am trying to combine both  &lt;EM&gt;arr&lt;/EM&gt;  and &lt;EM&gt;est_arr&lt;/EM&gt; columns into single column. &lt;/P&gt;

&lt;P&gt;eg. &lt;/P&gt;

&lt;P&gt;name | type | arrivalTime&lt;BR /&gt;
   123  | aa | 2016-10-11T10:00:00    &amp;lt;- Next Bus&lt;BR /&gt;
   456  | aa | 2016-10-11T10:05:00&lt;BR /&gt;
   123  | aa  | 2016-10-11T10:07:00   &amp;lt;- Subsequent Bus&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 01:38:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230102#M68204</guid>
      <dc:creator>weiquanswq</dc:creator>
      <dc:date>2016-10-11T01:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two JsonArray into a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230103#M68205</link>
      <description>&lt;P&gt;Try the updated query&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 02:23:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230103#M68205</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-11T02:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two JsonArray into a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230104#M68206</link>
      <description>&lt;P&gt;I am trying to extract both ArrivingTiming for both "nextBus" and " SubsequentBus". then add them below one another.&lt;/P&gt;

&lt;P&gt;Hope this is clearer.&lt;BR /&gt;
eg. &lt;/P&gt;

&lt;TABLE&gt;&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;
&lt;TH&gt;&lt;STRONG&gt;arrivalTime&lt;/STRONG&gt;&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;TD&gt;2016-10-11T10:00:00              &amp;lt;- Next Bus&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;&lt;/TABLE&gt;

&lt;P&gt;----------------+----------------------------------------------------&lt;BR /&gt;
   456             | 2016-10-11T10:05:00              &amp;lt;- Next Bus&lt;BR /&gt;
----------------+----------------------------------------------------&lt;BR /&gt;
   123            | 2016-10-11T10:07:00         &amp;lt;- Subsequent Bus&lt;BR /&gt;
----------------+----------------------------------------------------&lt;BR /&gt;
   456            | 2016-10-11T10:12:00         &amp;lt;- Subsequent Bus&lt;BR /&gt;
----------------+----------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 09:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-JsonArray-into-a-single-column/m-p/230104#M68206</guid>
      <dc:creator>weiquanswq</dc:creator>
      <dc:date>2016-10-12T09:21:13Z</dc:date>
    </item>
  </channel>
</rss>

