<?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 Need help a parson json and extract in table format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Need-help-a-parson-json-and-extract-in-table-format/m-p/439318#M76601</link>
    <description>&lt;P&gt;Hi ,&lt;BR /&gt;
I have a json and i want to extract few details  in table format .&lt;/P&gt;

&lt;P&gt;The json array is like &lt;BR /&gt;
[features{&lt;BR /&gt;
elements{&lt;BR /&gt;
steps{&lt;BR /&gt;
name&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
failed:2,&lt;BR /&gt;
passed:0]&lt;/P&gt;

&lt;P&gt;My query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="jsondata.json"  index="art" sourcetype="_json"|mvexpand "features{}.elements{}.failed"|rename "features{}.elements{}.failed" as FailedNumber| eval Status=if(FailedNumber=0,"Pass","Fail")|table Status,FailedNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Status           FailedNumber&lt;/P&gt;

&lt;P&gt;Fail                   2 &lt;BR /&gt;
Pass                0 &lt;BR /&gt;
Fail                  1&lt;/P&gt;

&lt;P&gt;second query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="jsondata.json" host="CDC2-L-CG72VP2" index="art" sourcetype="_json"|spath output=myfield path="features{}.elements{}.steps{0}.name"|mvexpand myfield |table myfield
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;myfield↕ &lt;/P&gt;

&lt;P&gt;the testcase name is "ValidateNetworkBHUtilization" &lt;BR /&gt;
the testcase is ValidateTrendAmbulatoryCondition &lt;BR /&gt;
the testcase is TrendHomeHealthCondition &lt;/P&gt;

&lt;P&gt;I want ,&lt;/P&gt;

&lt;P&gt;Status           FailedNumber     myfield↕ &lt;/P&gt;

&lt;P&gt;Fail                   2                         the testcase name is "ValidateNetworkBHUtilization" &lt;BR /&gt;
Pass                0                          the testcase is ValidateTrendAmbulatoryCondition &lt;BR /&gt;
Fail                  1                          the testcase is TrendHomeHealthCondition &lt;/P&gt;</description>
    <pubDate>Sun, 05 May 2019 16:28:10 GMT</pubDate>
    <dc:creator>usharaniallwyn</dc:creator>
    <dc:date>2019-05-05T16:28:10Z</dc:date>
    <item>
      <title>Need help a parson json and extract in table format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-help-a-parson-json-and-extract-in-table-format/m-p/439318#M76601</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;
I have a json and i want to extract few details  in table format .&lt;/P&gt;

&lt;P&gt;The json array is like &lt;BR /&gt;
[features{&lt;BR /&gt;
elements{&lt;BR /&gt;
steps{&lt;BR /&gt;
name&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
failed:2,&lt;BR /&gt;
passed:0]&lt;/P&gt;

&lt;P&gt;My query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="jsondata.json"  index="art" sourcetype="_json"|mvexpand "features{}.elements{}.failed"|rename "features{}.elements{}.failed" as FailedNumber| eval Status=if(FailedNumber=0,"Pass","Fail")|table Status,FailedNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Status           FailedNumber&lt;/P&gt;

&lt;P&gt;Fail                   2 &lt;BR /&gt;
Pass                0 &lt;BR /&gt;
Fail                  1&lt;/P&gt;

&lt;P&gt;second query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="jsondata.json" host="CDC2-L-CG72VP2" index="art" sourcetype="_json"|spath output=myfield path="features{}.elements{}.steps{0}.name"|mvexpand myfield |table myfield
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;myfield↕ &lt;/P&gt;

&lt;P&gt;the testcase name is "ValidateNetworkBHUtilization" &lt;BR /&gt;
the testcase is ValidateTrendAmbulatoryCondition &lt;BR /&gt;
the testcase is TrendHomeHealthCondition &lt;/P&gt;

&lt;P&gt;I want ,&lt;/P&gt;

&lt;P&gt;Status           FailedNumber     myfield↕ &lt;/P&gt;

&lt;P&gt;Fail                   2                         the testcase name is "ValidateNetworkBHUtilization" &lt;BR /&gt;
Pass                0                          the testcase is ValidateTrendAmbulatoryCondition &lt;BR /&gt;
Fail                  1                          the testcase is TrendHomeHealthCondition &lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 16:28:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-help-a-parson-json-and-extract-in-table-format/m-p/439318#M76601</guid>
      <dc:creator>usharaniallwyn</dc:creator>
      <dc:date>2019-05-05T16:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need help a parson json and extract in table format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-help-a-parson-json-and-extract-in-table-format/m-p/439319#M76602</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="art" source="jsondata.json"  sourcetype="_json"
| multireport
[ mvexpand "features{}.elements{}.failed"|rename "features{}.elements{}.failed" as FailedNumber
| eval Status=if(FailedNumber=0,"Pass","Fail")
|table Status,FailedNumber
|stats count AS _serial]
[ search host="CDC2-L-CG72VP2"
|spath output=myfield path="features{}.elements{}.steps{0}.name"
|mvexpand myfield
|table myfield
| stats count AS _serial]
| selfjoin _serial
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 May 2019 23:25:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-help-a-parson-json-and-extract-in-table-format/m-p/439319#M76602</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-05T23:25:12Z</dc:date>
    </item>
  </channel>
</rss>

