<?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: JSON time field not parsed correctly in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/JSON-time-field-not-parsed-correctly/m-p/142235#M29097</link>
    <description>&lt;P&gt;OK, I found what was wrong: I forgot to link the entry in &lt;CODE&gt;props.conf&lt;/CODE&gt; with a source... Specifically I forgot to add&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype = nessusjson
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to the relevant entry which describes my input in &lt;CODE&gt;inputs.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I will leave the question and answer, in case someone stumbles upon one day, searching for time extraction in JSON.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Dec 2014 13:38:19 GMT</pubDate>
    <dc:creator>wsw70</dc:creator>
    <dc:date>2014-12-03T13:38:19Z</dc:date>
    <item>
      <title>JSON time field not parsed correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-time-field-not-parsed-correctly/m-p/142234#M29096</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I submit files with JSON-encoded lines to splunk, to a monitored directory. The fields are extracted correctly, except for the time which is not.&lt;/P&gt;

&lt;P&gt;My &lt;CODE&gt;props.conf&lt;/CODE&gt; file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[nessusjson]
INDEXED_EXTRACTIONS = json
KV_MODE = none
TIMESTAMP_FIELDS = 'N_scantime'
TIME_FORMAT = '%s'
MAX_TIMESTAMP_LOOKAHEAD = -1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried &lt;CODE&gt;KV_MODE = json&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Below is an example of a JSON line, as seen by splunk. The EPOCH in &lt;CODE&gt;N_scantime&lt;/CODE&gt; corresponds to &lt;CODE&gt;Thu, 27 Nov 2014 09:17:08 GMT&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;11/27/14 
3:22:38.000 PM  
{ [-] 
   N_exploit: false 
   N_exploit_malware: UNKNOWN 
   N_exploit_metasploit: UNKNOWN 
   N_exploit_metasploit_name: UNKNOWN 
   N_nettype: wazaatype 
   N_scantime: 1417079828 
   N_subnetname: wazaa name 
   N_timeduration: 680 
   N_timeend: Thu Nov 27 14:33:58 2014 
   N_timeend_epoch: 1417098838 
   N_timestart: Thu Nov 27 14:22:38 2014 
   N_timestart_epoch: 1417098158 
   N_vendor: java 
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The idea was to have a specific field ( &lt;CODE&gt;N_scantime&lt;/CODE&gt; ) in EPOCH format and other informational fields with the date ( &lt;CODE&gt;N_time...&lt;/CODE&gt;).&lt;BR /&gt;
I think I put in props.conf everything to indicate the field ( &lt;CODE&gt;TIMESTAMP_FIELDS&lt;/CODE&gt; - I tried both with quotes and without), the format ( &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; - which is a 10 digits EPOCH in my case) and the fact that the filed can be anywhere ( &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt;). I restarted the server for each test.&lt;/P&gt;

&lt;P&gt;It looks like the  &lt;CODE&gt;N_timestart&lt;/CODE&gt; field was parsed instead.&lt;/P&gt;

&lt;P&gt;Is there something I am still missing? &lt;/P&gt;

&lt;P&gt;Thank you for any pointers!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2014 12:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-time-field-not-parsed-correctly/m-p/142234#M29096</guid>
      <dc:creator>wsw70</dc:creator>
      <dc:date>2014-12-03T12:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: JSON time field not parsed correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-time-field-not-parsed-correctly/m-p/142235#M29097</link>
      <description>&lt;P&gt;OK, I found what was wrong: I forgot to link the entry in &lt;CODE&gt;props.conf&lt;/CODE&gt; with a source... Specifically I forgot to add&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype = nessusjson
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to the relevant entry which describes my input in &lt;CODE&gt;inputs.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I will leave the question and answer, in case someone stumbles upon one day, searching for time extraction in JSON.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2014 13:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-time-field-not-parsed-correctly/m-p/142235#M29097</guid>
      <dc:creator>wsw70</dc:creator>
      <dc:date>2014-12-03T13:38:19Z</dc:date>
    </item>
  </channel>
</rss>

