<?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 do I extract event timestamp from json log file at index time? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-event-timestamp-from-json-log-file-at-index/m-p/230029#M44779</link>
    <description>&lt;P&gt;But it looks like your timestamp field was already at the top of the json object ?&lt;BR /&gt;
"Request": {&lt;BR /&gt;
   "TimestampUtc": "2015-11-09T14:33:53.3239117Z",&lt;BR /&gt;
   "Headers": {&lt;/P&gt;

&lt;P&gt;Where exactly did you move it to ?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2016 14:28:13 GMT</pubDate>
    <dc:creator>bharat1478</dc:creator>
    <dc:date>2016-02-02T14:28:13Z</dc:date>
    <item>
      <title>How do I extract event timestamp from json log file at index time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-event-timestamp-from-json-log-file-at-index/m-p/230027#M44777</link>
      <description>&lt;P&gt;I'm trying to extract timestamps for log events that I am forwarding to Splunk as json log files, and instead of getting the date correctly from inside the json, Splunk seems to get the timestamp from the log file's &lt;EM&gt;Date Modified&lt;/EM&gt;. (that's the only datetime that matches, isn't that weird?)&lt;/P&gt;

&lt;P&gt;The json is properly formatted and validated, and is serialised to string using the Json.NET JsonConvert, so my json around the datetime looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Request": {
  "TimestampUtc": "2015-11-09T14:33:53.3239117Z",
  "Headers": {
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I set &lt;EM&gt;sourcetype=_json&lt;/EM&gt; for my UniversalForwarder in the &lt;EM&gt;inputs.conf&lt;/EM&gt; file for Splunk_TA_windows, monitoring a directory on my hard drive. Logfile names have the format service.log.json, and the TimestampUtc property is on the 10th line, about 140 characters in inside the object.&lt;/P&gt;

&lt;P&gt;On the Splunk server, the default props.conf has&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[_json]
pulldown_type = true
INDEXED_EXTRACTIONS = json
KV_MODE = none
AUTO_KV_JSON = false
category = Structured
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the local props.conf has&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[_json]
INDEXED_EXTRACTIONS = json
pulldown_type = true
KV_MODE = none
AUTO_KV_JSON = false
#TIMESTAMP_FIELDS = TimestampUtc
TIME_PREFIX=/"TimestampUtc": "/
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%7N%Z
#TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N
MAX_TIMESTAMP_LOOKAHEAD = 27
category = Structured
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone point me to the right configuration for this extraction? I have tried a multitude of combinations but without success.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:53:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-event-timestamp-from-json-log-file-at-index/m-p/230027#M44777</guid>
      <dc:creator>aenache</dc:creator>
      <dc:date>2020-09-29T07:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract event timestamp from json log file at index time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-event-timestamp-from-json-log-file-at-index/m-p/230028#M44778</link>
      <description>&lt;P&gt;Fixed! I needed to move the datetime property at the top level in the json object. Kept the same configuration settings. &lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 15:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-event-timestamp-from-json-log-file-at-index/m-p/230028#M44778</guid>
      <dc:creator>aenache</dc:creator>
      <dc:date>2015-11-17T15:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract event timestamp from json log file at index time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-event-timestamp-from-json-log-file-at-index/m-p/230029#M44779</link>
      <description>&lt;P&gt;But it looks like your timestamp field was already at the top of the json object ?&lt;BR /&gt;
"Request": {&lt;BR /&gt;
   "TimestampUtc": "2015-11-09T14:33:53.3239117Z",&lt;BR /&gt;
   "Headers": {&lt;/P&gt;

&lt;P&gt;Where exactly did you move it to ?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 14:28:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-event-timestamp-from-json-log-file-at-index/m-p/230029#M44779</guid>
      <dc:creator>bharat1478</dc:creator>
      <dc:date>2016-02-02T14:28:13Z</dc:date>
    </item>
  </channel>
</rss>

