<?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 Convert table generated by JSON into a timeline in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Convert-table-generated-by-JSON-into-a-timeline/m-p/513958#M87129</link>
    <description>&lt;P&gt;I have a service that is dropping a json object every 5 minutes. These objects contain multiple KeyValuePair Categories with multiple KVP Properies within them. If I use the following query:&lt;BR /&gt;&lt;BR /&gt;index= ****Query ****&lt;BR /&gt;| spath input=Properties.Data path=Items{} output=Items&lt;BR /&gt;| stats count by Items&lt;BR /&gt;| spath input=Items path=Props{} output=Props&lt;BR /&gt;| mvexpand Props&lt;BR /&gt;| spath input=Props&lt;BR /&gt;| spath input=Items&lt;BR /&gt;| fields - Items count Props*&lt;BR /&gt;| where CN="ClientId" AND PN="Client_authentication_success"&lt;BR /&gt;&lt;BR /&gt;Which generates a table:&lt;BR /&gt;CN | CV | PN | PV&lt;BR /&gt;(CategoryName | CategoryValue | PropertyName | PropertyValue)&lt;BR /&gt;&lt;BR /&gt;The problem is that I cannot seem to generate a timeline from that data. I think this is because its pulling ALL the data from the entire duration and none of it contains any time information for each individual log they belong to. So I may need to inject the time information early on before it aggregates all the data into one report.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm Assuming the table would need to look more like:&lt;BR /&gt;_time | CN | CV | PN | PV&lt;BR /&gt;&lt;BR /&gt;From there I'm assuming it would be something like:&lt;BR /&gt;| timechart span=5m sum(PV) by CV where sum in top10&lt;BR /&gt;To get a timeline going.&lt;BR /&gt;&lt;BR /&gt;Here is an example of one record:&lt;BR /&gt;{"Items":[{"CN":"ClientId","CV":"ABC0001","Props":[{"PN":"Client_authentication_success","PV":10}]},{"CN":"ClientId","CV":"CDE0001","Props":[{"PN":"Client_authentication_success","PV":754}]},{"CN":"ClientId","CV":"ABC0002","Props":[{"PN":"Client_authentication_success","PV":33}]}]}&lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2020 19:16:38 GMT</pubDate>
    <dc:creator>topherbirth</dc:creator>
    <dc:date>2020-08-13T19:16:38Z</dc:date>
    <item>
      <title>Convert table generated by JSON into a timeline</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-table-generated-by-JSON-into-a-timeline/m-p/513958#M87129</link>
      <description>&lt;P&gt;I have a service that is dropping a json object every 5 minutes. These objects contain multiple KeyValuePair Categories with multiple KVP Properies within them. If I use the following query:&lt;BR /&gt;&lt;BR /&gt;index= ****Query ****&lt;BR /&gt;| spath input=Properties.Data path=Items{} output=Items&lt;BR /&gt;| stats count by Items&lt;BR /&gt;| spath input=Items path=Props{} output=Props&lt;BR /&gt;| mvexpand Props&lt;BR /&gt;| spath input=Props&lt;BR /&gt;| spath input=Items&lt;BR /&gt;| fields - Items count Props*&lt;BR /&gt;| where CN="ClientId" AND PN="Client_authentication_success"&lt;BR /&gt;&lt;BR /&gt;Which generates a table:&lt;BR /&gt;CN | CV | PN | PV&lt;BR /&gt;(CategoryName | CategoryValue | PropertyName | PropertyValue)&lt;BR /&gt;&lt;BR /&gt;The problem is that I cannot seem to generate a timeline from that data. I think this is because its pulling ALL the data from the entire duration and none of it contains any time information for each individual log they belong to. So I may need to inject the time information early on before it aggregates all the data into one report.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm Assuming the table would need to look more like:&lt;BR /&gt;_time | CN | CV | PN | PV&lt;BR /&gt;&lt;BR /&gt;From there I'm assuming it would be something like:&lt;BR /&gt;| timechart span=5m sum(PV) by CV where sum in top10&lt;BR /&gt;To get a timeline going.&lt;BR /&gt;&lt;BR /&gt;Here is an example of one record:&lt;BR /&gt;{"Items":[{"CN":"ClientId","CV":"ABC0001","Props":[{"PN":"Client_authentication_success","PV":10}]},{"CN":"ClientId","CV":"CDE0001","Props":[{"PN":"Client_authentication_success","PV":754}]},{"CN":"ClientId","CV":"ABC0002","Props":[{"PN":"Client_authentication_success","PV":33}]}]}&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 19:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-table-generated-by-JSON-into-a-timeline/m-p/513958#M87129</guid>
      <dc:creator>topherbirth</dc:creator>
      <dc:date>2020-08-13T19:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert table generated by JSON into a timeline</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-table-generated-by-JSON-into-a-timeline/m-p/513976#M87131</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;can you try if you adding replace your stats with&lt;/P&gt;&lt;LI-CODE lang="java"&gt;| stats values(_time) as _time count by Items&lt;/LI-CODE&gt;&lt;P&gt;on your query?&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 20:11:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-table-generated-by-JSON-into-a-timeline/m-p/513976#M87131</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-13T20:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert table generated by JSON into a timeline</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-table-generated-by-JSON-into-a-timeline/m-p/513997#M87132</link>
      <description>&lt;P&gt;I managed to get a working query:&lt;BR /&gt;&lt;BR /&gt;| spath input=Properties.Data path=Items{} output=Items&lt;BR /&gt;| mvexpand Items&lt;BR /&gt;| rename Items as _raw&lt;BR /&gt;| spath path=Props{} output=ThePs&lt;BR /&gt;| mvexpand ThePs&lt;BR /&gt;| kv&lt;BR /&gt;| spath input=ThePs path=PN output=PN&lt;BR /&gt;| spath input=ThePs path=PV output=PV&lt;BR /&gt;| table _time, CN, CV, PN, PV&lt;BR /&gt;| timechart span=5m sum(PV) by CV where sum in top10&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 22:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-table-generated-by-JSON-into-a-timeline/m-p/513997#M87132</guid>
      <dc:creator>topherbirth</dc:creator>
      <dc:date>2020-08-13T22:07:21Z</dc:date>
    </item>
  </channel>
</rss>

