<?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 json array and plot to a line chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559102#M158837</link>
    <description>&lt;P&gt;I have the following data that I would like to parse and put into a line chart.&amp;nbsp; There are millions of rows of data, and I'm looking to find tasks that seem to take the longest.&amp;nbsp; I can't for the life of me get it to parse, even after reading the many accepted answers.&amp;nbsp; Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Here's a sample of the data.&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;{
    "latency_info": [{
            "started": "0",
            "task": "Start"
        }, {
            "started": "0",
            "task": "api-routing"
        }, {
            "started": "1",
            "task": "api-cors"
        }, {
            "started": "1",
            "task": "api-client-identification"
        }, {
            "started": "1",
            "task": "api-rate-limit"
        }, {
            "started": "1",
            "task": "api-security"
        }, {
            "started": "1",
            "task": "api-execute"
        }, {
            "started": "1",
            "task": "assembly-invoke"
        }, {
            "started": "2",
            "task": "api-result"
        }
    ]
}&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;</description>
    <pubDate>Mon, 12 Jul 2021 14:55:45 GMT</pubDate>
    <dc:creator>matt-1</dc:creator>
    <dc:date>2021-07-12T14:55:45Z</dc:date>
    <item>
      <title>Parse json array and plot to a line chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559102#M158837</link>
      <description>&lt;P&gt;I have the following data that I would like to parse and put into a line chart.&amp;nbsp; There are millions of rows of data, and I'm looking to find tasks that seem to take the longest.&amp;nbsp; I can't for the life of me get it to parse, even after reading the many accepted answers.&amp;nbsp; Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Here's a sample of the data.&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;{
    "latency_info": [{
            "started": "0",
            "task": "Start"
        }, {
            "started": "0",
            "task": "api-routing"
        }, {
            "started": "1",
            "task": "api-cors"
        }, {
            "started": "1",
            "task": "api-client-identification"
        }, {
            "started": "1",
            "task": "api-rate-limit"
        }, {
            "started": "1",
            "task": "api-security"
        }, {
            "started": "1",
            "task": "api-execute"
        }, {
            "started": "1",
            "task": "assembly-invoke"
        }, {
            "started": "2",
            "task": "api-result"
        }
    ]
}&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;</description>
      <pubDate>Mon, 12 Jul 2021 14:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559102#M158837</guid>
      <dc:creator>matt-1</dc:creator>
      <dc:date>2021-07-12T14:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Parse json array and plot to a line chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559114#M158844</link>
      <description>&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;maybe you can try something like this:&lt;/P&gt;&lt;P&gt;source="test.json" host="splunk-aio01" sourcetype="_json"&lt;BR /&gt;|rename latency_info{}.started as started, latency_info{}.task as task&lt;BR /&gt;| eval temp_field=if(isnotnull(task),mvzip(started, task),"")&lt;BR /&gt;| mvexpand temp_field&lt;BR /&gt;| makemv temp_field delim=","&lt;BR /&gt;| eval started=mvindex(temp_field,0)&lt;BR /&gt;| eval task=mvindex(temp_field,1)&lt;BR /&gt;|stats sum(started) by task&lt;/P&gt;&lt;P&gt;Michel&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 15:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559114#M158844</guid>
      <dc:creator>michel_wolf</dc:creator>
      <dc:date>2021-07-12T15:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Parse json array and plot to a line chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559149#M158863</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Michel,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response!&amp;nbsp; It seems that the problem is my data.&amp;nbsp; I didn't mention it, and didn't want to post the full data set, but the json, while at the root level, does have other data.&amp;nbsp; I added just the latency data to my instance and the line chart worked perfectly.&amp;nbsp; Do you happen to know what to do if there's other data in the json message?&amp;nbsp; &lt;SPAN&gt;If possible, I can just do a field extraction and parse that data, though I haven't been able to find examples of doing that.&lt;/SPAN&gt;&amp;nbsp;Here's a sample of the other information that isn't needed in the chart:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "rate_limit": {
        "default": {
            "reject": "false",
            "shared": "true",
            "count": "94",
            "limit": "100",
            "period": "1",
            "unit": "hour",
            "interval": "1"
        }
    },
    "@version": "1",
    "request_method": "GET",
    "datetime": "2021-07-12T14:24:41.162Z",
    "time_to_serve_request": "2",
    "bytes_sent": "0",
    "request_http_headers": [],
    "headers": {
        "content_length": "1939",
        "http_accept": null,
        "http_version": "HTTP/1.0",
        "connection": "close",
        "http_user_agent": null
    },
    "response_http_headers": [],
    "latency_info": [{
            "started": "0",
            "task": "Start"
        }, {
            "started": "0",
            "task": "api-routing"
        }, {
            "started": "1",
            "task": "api-cors"
        }, {
            "started": "1",
            "task": "api-client-identification"
        }, {
            "started": "1",
            "task": "api-rate-limit"
        }, {
            "started": "1",
            "task": "api-security"
        }, {
            "started": "1",
            "task": "api-execute"
        }, {
            "started": "1",
            "task": "assembly-invoke"
        }, {
            "started": "2",
            "task": "api-result"
        }
    ],
    "response_body": "",
    "status_code": "200 OK",
    "transaction_id": "123456789",
    "request_protocol": "https",
    "request_body": ""
}&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;</description>
      <pubDate>Mon, 12 Jul 2021 18:19:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559149#M158863</guid>
      <dc:creator>matt-1</dc:creator>
      <dc:date>2021-07-12T18:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Parse json array and plot to a line chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559221#M158886</link>
      <description>&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;I tried this again with your new data and for me the search was the same to receive the results, maybe you have other field names for this here&lt;BR /&gt;|rename latency_info{}.started as started, latency_info{}.task as task&lt;/P&gt;&lt;P&gt;just look in some of your data and make sure if you look to the interesting fields the name for the started and task field are the same as in my rename command here, if not you have just to edit the rename command.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 06:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parse-json-array-and-plot-to-a-line-chart/m-p/559221#M158886</guid>
      <dc:creator>michel_wolf</dc:creator>
      <dc:date>2021-07-13T06:22:18Z</dc:date>
    </item>
  </channel>
</rss>

