<?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: Spath parsing error, last event in JSON in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311580#M58494</link>
    <description>&lt;P&gt;Not 100% on that sed command but something like that should work.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2017 16:33:38 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2017-02-20T16:33:38Z</dc:date>
    <item>
      <title>Spath parsing error, last event in JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311578#M58492</link>
      <description>&lt;P&gt;I have the following JSON in each event&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;payload={fields1=values1, field2=value2, etc}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When running spath I encounter an error with an parameter called eventTime.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; my search | spath input=payload
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if the eventTime parameter is the last parameter in the JSON blob it will not parse correctly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;payload={fields1=values1,....., eventTime=2017-02-20 15:43:53 432}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk will parse the value as &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventTime=2017-02-20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the eventTime parameter is in any other location in the JSON then the parameter will parse correctly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; payload={fields1=values1,......,eventTime=2017-02-20 15:46:02 154,fieldsn=valuesn,...etc}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk will parse the parameter as &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventTime=2017-02-20 15:46:02 154
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does anyone know how to correct this in Splunk or do I need to request a change in logging?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 15:54:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311578#M58492</guid>
      <dc:creator>DanielFordWA</dc:creator>
      <dc:date>2017-02-20T15:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Spath parsing error, last event in JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311579#M58493</link>
      <description>&lt;P&gt;It's improper JSON.  The DATETIME stamp should be quoted.&lt;/P&gt;

&lt;P&gt;You can use rex mode=sed to add quotes at search time prior to the spath command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  ...| rex mode=sed field=payload 's/(eventTime\=)(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\s+\d{3})/\1"\2"/g'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Feb 2017 16:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311579#M58493</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-02-20T16:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Spath parsing error, last event in JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311580#M58494</link>
      <description>&lt;P&gt;Not 100% on that sed command but something like that should work.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 16:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311580#M58494</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-02-20T16:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Spath parsing error, last event in JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311581#M58495</link>
      <description>&lt;P&gt;the sed command is not working but its enough to go on!&lt;/P&gt;

&lt;P&gt;I'll make sure the JSON is correct.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 16:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Spath-parsing-error-last-event-in-JSON/m-p/311581#M58495</guid>
      <dc:creator>DanielFordWA</dc:creator>
      <dc:date>2017-02-20T16:38:57Z</dc:date>
    </item>
  </channel>
</rss>

