<?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 parse JSON with multiple array to barchart in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-parse-JSON-with-multiple-array-to-barchart/m-p/462125#M45508</link>
    <description>&lt;P&gt;@cuongnguyen112 &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH  | rename sysinfo.ram{}.* as * | eval tmp =mvzip(name,usage) | mvexpand tmp | eval name=mvindex(split(tmp,","),0),usage=mvindex(split(tmp,","),1) | table name usage
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Sample Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="{\"source\": \"sadmin\",\"sysinfo\": {\"ram\": [{\"name\": \"ram\",\"usage\": 1243},{\"name\": \"ram0\",\"usage\": 1215},{\"name\": \"ram1\",\"usage\": 2151}],}}" | extract | rename sysinfo.ram{}.* as * | eval tmp =mvzip(name,usage) | mvexpand tmp | eval name=mvindex(split(tmp,","),0),usage=mvindex(split(tmp,","),1) | table name usage
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2019 06:47:45 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-10-17T06:47:45Z</dc:date>
    <item>
      <title>How to parse JSON with multiple array to barchart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-parse-JSON-with-multiple-array-to-barchart/m-p/462124#M45507</link>
      <description>&lt;P&gt;hi, i got data like this &lt;BR /&gt;
{&lt;BR /&gt;
  "source": "sadmin",&lt;BR /&gt;
  "sysinfo": {&lt;BR /&gt;
    "ram": [&lt;BR /&gt;
      {&lt;BR /&gt;
        "name": "ram",&lt;BR /&gt;
        "usage": 1243&lt;BR /&gt;
      },&lt;BR /&gt;
      {&lt;BR /&gt;
        "name": "ram0",&lt;BR /&gt;
        "usage": 1215&lt;BR /&gt;
      },&lt;BR /&gt;
      {&lt;BR /&gt;
        "name": "ram1",&lt;BR /&gt;
        "usage": 2151&lt;BR /&gt;
      }&lt;BR /&gt;
    ],&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;i need to create a barchart from these data like img below: &lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7833i0347AAD694B31AF7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Can any one help me please !&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 04:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-parse-JSON-with-multiple-array-to-barchart/m-p/462124#M45507</guid>
      <dc:creator>cuongnguyen112</dc:creator>
      <dc:date>2019-10-17T04:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse JSON with multiple array to barchart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-parse-JSON-with-multiple-array-to-barchart/m-p/462125#M45508</link>
      <description>&lt;P&gt;@cuongnguyen112 &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH  | rename sysinfo.ram{}.* as * | eval tmp =mvzip(name,usage) | mvexpand tmp | eval name=mvindex(split(tmp,","),0),usage=mvindex(split(tmp,","),1) | table name usage
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Sample Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="{\"source\": \"sadmin\",\"sysinfo\": {\"ram\": [{\"name\": \"ram\",\"usage\": 1243},{\"name\": \"ram0\",\"usage\": 1215},{\"name\": \"ram1\",\"usage\": 2151}],}}" | extract | rename sysinfo.ram{}.* as * | eval tmp =mvzip(name,usage) | mvexpand tmp | eval name=mvindex(split(tmp,","),0),usage=mvindex(split(tmp,","),1) | table name usage
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 06:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-parse-JSON-with-multiple-array-to-barchart/m-p/462125#M45508</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-10-17T06:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse JSON with multiple array to barchart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-parse-JSON-with-multiple-array-to-barchart/m-p/462126#M45509</link>
      <description>&lt;P&gt;Thank you, that's totally what is need&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 07:30:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-parse-JSON-with-multiple-array-to-barchart/m-p/462126#M45509</guid>
      <dc:creator>cuongnguyen112</dc:creator>
      <dc:date>2019-10-17T07:30:51Z</dc:date>
    </item>
  </channel>
</rss>

