<?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 split JSON events to usable format? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-JSON-events-to-usable-format/m-p/494772#M84447</link>
    <description>&lt;P&gt;1) you are looking for the &lt;CODE&gt;spath&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;2) Your ingestion stanzas should be telling the system that the sourcetype is a json, so it can do autoextraction.&lt;/P&gt;

&lt;P&gt;3) Splunk happily accepts data from any monitoring or analysis tool, IoT object, or other monitoring solution, and it's not sacrilege, its canon.  mmooooarrr daaataaa!!!!    &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;  &lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 15:54:41 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2020-05-07T15:54:41Z</dc:date>
    <item>
      <title>How to split JSON events to usable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-JSON-events-to-usable-format/m-p/494771#M84446</link>
      <description>&lt;P&gt;Good morning all,&lt;/P&gt;

&lt;P&gt;Complete novice with JSON workings, but essentially I have managed to configure a REST api that's ingesting the result of an alternative monitoring tool (sacrilage I know), running version 7.3.0. The events are coming in in JSON format as follows:-&lt;/P&gt;

&lt;P&gt;{ [-]&lt;BR /&gt;
   channels: [ [-]&lt;BR /&gt;
     { [-]&lt;BR /&gt;
       lastvalue: 0 #&lt;BR /&gt;
       lastvalue_raw: 0&lt;BR /&gt;
       name: $["Data"]["Attributes"]["ConnectionTime"]&lt;BR /&gt;
       name_raw: $["Data"]["Attributes"]["ConnectionTime"]&lt;BR /&gt;
     }&lt;BR /&gt;
     { [-]&lt;BR /&gt;
       lastvalue: 15,204 #&lt;BR /&gt;
       lastvalue_raw: 15204&lt;BR /&gt;
       name: $["Data"]["Attributes"]["DownloadTime"]&lt;BR /&gt;
       name_raw: $["Data"]["Attributes"]["DownloadTime"]&lt;BR /&gt;
     }&lt;BR /&gt;
     { [-]&lt;BR /&gt;
       lastvalue: 0 #&lt;BR /&gt;
       lastvalue_raw: 0&lt;BR /&gt;
       name: $["Data"]["Attributes"]["ErrorCode"]&lt;BR /&gt;
       name_raw: $["Data"]["Attributes"]["ErrorCode"]&lt;BR /&gt;
     }&lt;BR /&gt;
     { [-]&lt;BR /&gt;
       lastvalue: 0 #&lt;BR /&gt;
       lastvalue_raw: 0&lt;BR /&gt;
       name: $["Data"]["Attributes"]["ResolveTime"]&lt;BR /&gt;
       name_raw: $["Data"]["Attributes"]["ResolveTime"]&lt;BR /&gt;
     }&lt;BR /&gt;
     { [-]&lt;BR /&gt;
       lastvalue: 2,190 #&lt;BR /&gt;
       lastvalue_raw: 2190&lt;BR /&gt;
       name: $["Data"]["Attributes"]["ServerId"]&lt;BR /&gt;
       name_raw: $["Data"]["Attributes"]["ServerId"]&lt;BR /&gt;
     }&lt;/P&gt;

&lt;P&gt;What I was hoping to do was produce a simple search that displays the name: $["Data"]["Attributes"] field with the corrseponding last_value next to it. However, as this is coming in as an array, I cannot simply do that and despite some search manipulation, I feel I'm moving further and further away from a simpler solution. Would someone be able to assist me in separating out the name: $["Data"]["Attributes"] fields into separate useable fields, and taking the lastvalue with it please?&lt;/P&gt;

&lt;P&gt;Raw event looks as such:-&lt;/P&gt;

&lt;P&gt;{"version":"19.3.51.2830","treesize":0,"channels":[{"name":"$["Data"]["Attributes"]["ConnectionTime"]","name_raw":"$[\"Data\"][\"Attributes\"][\"ConnectionTime\"]","lastvalue":"0 #","lastvalue_raw":0.0000},{"name":"$["Data"]["Attributes"]["DownloadTime"]","name_raw":"$[\"Data\"][\"Attributes\"][\"DownloadTime\"]","lastvalue":"15,204 #","lastvalue_raw":15204.0000},{"name":"$["Data"]["Attributes"]["ErrorCode"]","name_raw":"$[\"Data\"][\"Attributes\"][\"ErrorCode\"]","lastvalue":"0 #","lastvalue_raw":0.0000},{"name":"$["Data"]["Attributes"]["ResolveTime"]","name_raw":"$[\"Data\"][\"Attributes\"][\"ResolveTime\"]","lastvalue":"0 #","lastvalue_raw":0.0000},{"name":"$["Data"]["Attributes"]["ServerId"]","name_raw":"$[\"Data\"][\"Attributes\"][\"ServerId\"]","lastvalue":"2,190 #","lastvalue_raw":2190.0000},{"name":"$["Data"]["Attributes"]["StagingMode"]","name_raw":"$[\"Data\"][\"Attributes\"][\"StagingMode\"]","lastvalue":"0 #","lastvalue_raw":0.0000},{"name":"$["Data"]["Attributes"]["TotalTime"]","name_raw":"$[\"Data\"][\"Attributes\"][\"TotalTime\"]","lastvalue":"15,204 #","lastvalue_raw":15204.0000},{"name":"$["Data"]["Id"]","name_raw":"$[\"Data\"][\"Id\"]","lastvalue":"51,237,312,666 #","lastvalue_raw":51237312666.0000},{"name":"$["Relationships"]["0"]["Id"]","name_raw":"$[\"Relationships\"][\"0\"][\"Id\"]","lastvalue":"2,190 #","lastvalue_raw":2190.0000},{"name":"$["Relationships"]["1"]["Id"]","name_raw":"$[\"Relationships\"][\"1\"][\"Id\"]","lastvalue":"51,237,312,666 #","lastvalue_raw":51237312666.0000},{"name":"Download Time","lastvalue":"0 s","lastvalue_raw":0.0000},{"name":"Downtime","lastvalue":""},{"name":"Error Code","lastvalue":"0 #","lastvalue_raw":0.0000},{"name":"Response Time","lastvalue":"350 msec","lastvalue_raw":350.0000}]}&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-JSON-events-to-usable-format/m-p/494771#M84446</guid>
      <dc:creator>Barty</dc:creator>
      <dc:date>2020-09-30T05:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to split JSON events to usable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-JSON-events-to-usable-format/m-p/494772#M84447</link>
      <description>&lt;P&gt;1) you are looking for the &lt;CODE&gt;spath&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;2) Your ingestion stanzas should be telling the system that the sourcetype is a json, so it can do autoextraction.&lt;/P&gt;

&lt;P&gt;3) Splunk happily accepts data from any monitoring or analysis tool, IoT object, or other monitoring solution, and it's not sacrilege, its canon.  mmooooarrr daaataaa!!!!    &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;  &lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 15:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-JSON-events-to-usable-format/m-p/494772#M84447</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-05-07T15:54:41Z</dc:date>
    </item>
  </channel>
</rss>

