<?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 parse mv json into multiline chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/parse-mv-json-into-multiline-chart/m-p/562138#M195498</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a field named Msg which contains json. That json contains some values and an array. I need to get each item from the array and put it on its own line (line chart line) and also get one of the header values as a line.&lt;/P&gt;&lt;P&gt;So on my line chart I want a line for each of:&amp;nbsp; totalSorsTime, internalProcessingTime, remote_a, remote_b, etc&lt;/P&gt;&lt;P&gt;The closest I can get is this-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wdpr_S0001469 source="*-vas-latest*" "Orchestration Summary"
| spath input=Msg    &amp;lt;&amp;lt;&amp;lt;&amp;lt; Msg field contains the json
| table _time, totalTime, totalSorsTime, internalProcessingTime, sorMetrics{}.sor, sorMetrics{}.executionTimeMs&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any nudge in the right direction would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "totalTime": 2820,
  "totalSorsTime": 1505,
  "internalProcessingTime": 1315,
  "sorMetrics": [
    {
      "sor": "remote_a",
      "executionTimeMs": 77
    },
    {
      "sor": "remote_b",
      "executionTimeMs": 27
    },
    {
      "sor": "remote_c",
      "executionTimeMs": 759
    },
    {
      "sor": "remote_d",
      "executionTimeMs": 199
    },
    {
      "sor": "remote_e",
      "executionTimeMs": 85
    },
    {
      "sor": "remote_f",
      "executionTimeMs": 252
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Aug 2021 16:30:00 GMT</pubDate>
    <dc:creator>brianbcampbell</dc:creator>
    <dc:date>2021-08-05T16:30:00Z</dc:date>
    <item>
      <title>parse mv json into multiline chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/parse-mv-json-into-multiline-chart/m-p/562138#M195498</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a field named Msg which contains json. That json contains some values and an array. I need to get each item from the array and put it on its own line (line chart line) and also get one of the header values as a line.&lt;/P&gt;&lt;P&gt;So on my line chart I want a line for each of:&amp;nbsp; totalSorsTime, internalProcessingTime, remote_a, remote_b, etc&lt;/P&gt;&lt;P&gt;The closest I can get is this-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wdpr_S0001469 source="*-vas-latest*" "Orchestration Summary"
| spath input=Msg    &amp;lt;&amp;lt;&amp;lt;&amp;lt; Msg field contains the json
| table _time, totalTime, totalSorsTime, internalProcessingTime, sorMetrics{}.sor, sorMetrics{}.executionTimeMs&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any nudge in the right direction would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "totalTime": 2820,
  "totalSorsTime": 1505,
  "internalProcessingTime": 1315,
  "sorMetrics": [
    {
      "sor": "remote_a",
      "executionTimeMs": 77
    },
    {
      "sor": "remote_b",
      "executionTimeMs": 27
    },
    {
      "sor": "remote_c",
      "executionTimeMs": 759
    },
    {
      "sor": "remote_d",
      "executionTimeMs": 199
    },
    {
      "sor": "remote_e",
      "executionTimeMs": 85
    },
    {
      "sor": "remote_f",
      "executionTimeMs": 252
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 16:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/parse-mv-json-into-multiline-chart/m-p/562138#M195498</guid>
      <dc:creator>brianbcampbell</dc:creator>
      <dc:date>2021-08-05T16:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: parse mv json into multiline chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/parse-mv-json-into-multiline-chart/m-p/562144#M195500</link>
      <description>&lt;P&gt;Your example had duplicate entries for remote_d so I changed that - if you have duplicates in your real data, you will end up with some mv fields. As usual, the part before the blank lines just sets up some sample data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval msg="{
  \"totalTime\": 2820,
  \"totalSorsTime\": 1505,
  \"internalProcessingTime\": 1315,
  \"sorMetrics\": [
    {
      \"sor\": \"remote_a\",
      \"executionTimeMs\": 77
    },
    {
      \"sor\": \"remote_b\",
      \"executionTimeMs\": 27
    },
    {
      \"sor\": \"remote_c\",
      \"executionTimeMs\": 759
    },
    {
      \"sor\": \"remote_d\",
      \"executionTimeMs\": 199
    },
    {
      \"sor\": \"remote_e\",
      \"executionTimeMs\": 106
    },
    {
      \"sor\": \"remote_f\",
      \"executionTimeMs\": 85
    },
    {
      \"sor\": \"remote_g\",
      \"executionTimeMs\": 252
    }
  ]
}"



| spath input=msg path="totalSorsTime"
| spath input=msg path="internalProcessingTime"
| spath input=msg path="sorMetrics{}" output="sorMetrics"
| streamstats count as _row 
| mvexpand sorMetrics
| spath input=sorMetrics
| eval {sor}=executionTimeMs
| fields - msg sorMetrics sor executionTimeMs
| stats values(*) as * by _row
| table *&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Aug 2021 22:54:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/parse-mv-json-into-multiline-chart/m-p/562144#M195500</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-04T22:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: parse mv json into multiline chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/parse-mv-json-into-multiline-chart/m-p/562280#M195560</link>
      <description>&lt;P&gt;It says "Legend" next to your name and it is a deserved title! Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 16:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/parse-mv-json-into-multiline-chart/m-p/562280#M195560</guid>
      <dc:creator>brianbcampbell</dc:creator>
      <dc:date>2021-08-05T16:40:07Z</dc:date>
    </item>
  </channel>
</rss>

