<?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 edit my props.conf for proper timestamp extraction? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164915#M33444</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD = 512
TIME_PREFIX  = \"id\"\: \"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should capture the "id": " group, assuming this is the only id string in the event. You also should look at adjusting the lookahead depending on how far into the event the timestamp is..&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2015 23:48:35 GMT</pubDate>
    <dc:creator>esix_splunk</dc:creator>
    <dc:date>2015-04-28T23:48:35Z</dc:date>
    <item>
      <title>How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164909#M33438</link>
      <description>&lt;P&gt;My log sample event looks like this&lt;BR /&gt;
&lt;STRONG&gt;"id": "2015-03-02_20-10-12"&lt;/STRONG&gt;, "keepLog": false&lt;BR /&gt;
&lt;STRONG&gt;"id": "2015-03-19_10-26-38"&lt;/STRONG&gt;, "keepLog": false&lt;/P&gt;

&lt;P&gt;etc. I have to extract this timestamp for the various events. My props.conf looks like below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json_no_timestamp]
TIME_PREFIX = :\s
TIME_FORMAT = %Y-%m-%d_%H-%M-%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json_no_timestamp]
TIME_PREFIX = "id":\s
TIME_FORMAT = %Y-%m-%d_%H-%M-%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but still doesn't work. Its still showing the system time for the events.  How should my TIME prefix and format look like?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 00:15:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164909#M33438</guid>
      <dc:creator>hvaithia</dc:creator>
      <dc:date>2015-04-24T00:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164910#M33439</link>
      <description>&lt;P&gt;Hello! &lt;BR /&gt;
Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [json_no_timestamp]
 TIME_PREFIX = "id":\s\"
 TIME_FORMAT = %Y-%m-%d_%H-%M-%S
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Apr 2015 04:30:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164910#M33439</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-04-24T04:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164911#M33440</link>
      <description>&lt;P&gt;To build on this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [json_no_timestamp]
  TIME_PREFIX = ^\"id\":\s\"
  TIME_FORMAT = %Y-%m-%d_%H-%M-%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Look from the beginning of the line and also, just to be safe, escape the quotes..&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 04:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164911#M33440</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-04-24T04:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164912#M33441</link>
      <description>&lt;P&gt;I think its my bad to have described my logs in part. But my actual logs look like below&lt;/P&gt;

&lt;P&gt;{"building": false, "changeSet": {"items": [], "kind": null}, "builtOn": "rhel6", "description": null, "artifacts": [], "timestamp": 1430241584496, "number": 13, "actions": [{"causes": [{"upstreamBuild": 14, "shortDescription": "Started by upstream project \"answers\" build number 14", "upstreamProject": "answers", "upstreamUrl": "job/answers/"}]}, {}, {}, {}, {}, {"highlightsData": "[{\"Previous Job\":\"answers#14\"},{\"Previous Job\":\"answers_se\"},{\"Build host\":\"rhel6\"}]", "highlightsTable": "&lt;/P&gt;&lt;H4&gt;Global Patterns&lt;/H4&gt;&lt;B&gt;Previous Job:&lt;/B&gt;&lt;B&gt;Started by &lt;A href="https://community.splunk.com/hudson/job/answers/14/" target="_blank"&gt;answers&lt;/A&gt;&lt;/B&gt;&lt;B&gt;Previous Job:&lt;/B&gt;&lt;B&gt;Started by &lt;A href="https://community.splunk.com/hudson/job/answers/8/" target="_blank"&gt;answers #8&lt;/A&gt;&lt;/B&gt;&lt;B&gt;Build host:&lt;/B&gt;&lt;B&gt;Built on &lt;A href="https://community.splunk.com/hudson/computer/rhel6/" target="_blank"&gt;rhel6&lt;/A&gt;&lt;/B&gt;"}], "id": "2015-04-28_17-19-44", "keepLog": false, "url": "&lt;A href="http://thefactory.xyz.com:9999/jenkins/job/answers/13/" target="_blank"&gt;http://thefactory.xyz.com:9999/jenkins/job/answers/13/&lt;/A&gt;", "culprits": [], "result": "SUCCESS", "executor": null, "duration": 377658, "fullDisplayName": "answers", "estimatedDuration": 298415}&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This is just one line. The entire splunk-logged file is a json dump. now I need to extract the time from either the 'ID' field or the 'timestamp' field. Will the same props work for these? (I tried it didn't). My ultimate aim is to have the logs logged in that timestamp (2015-04-28 in this case) instead of when I create this logs. Any help will be largely useful....&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164912#M33441</guid>
      <dc:creator>hvaithia</dc:creator>
      <dc:date>2020-09-28T19:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164913#M33442</link>
      <description>&lt;P&gt;Thanks for the quick response. I think its my bad to have described my logs in part. But my actual logs look like below&lt;/P&gt;

&lt;P&gt;{"building": false, "changeSet": {"items": [], "kind": null}, "builtOn": "rhel6", "description": null, "artifacts": [], "timestamp": 1430241584496, "number": 13, "actions": [{"causes": [{"upstreamBuild": 14, "shortDescription": "Started by upstream project \"answers\" build number 14", "upstreamProject": "answers", "upstreamUrl": "job/answers/"}]}, {}, {}, {}, {}, {"highlightsData": "[{\"Previous Job\":\"answers#14\"},{\"Previous Job\":\"answers_se\"},{\"Build host\":\"rhel6\"}]", "highlightsTable": "&lt;/P&gt;&lt;H4&gt;Global Patterns&lt;/H4&gt;&lt;B&gt;Previous Job:&lt;/B&gt;&lt;B&gt;Started by &lt;A href="https://community.splunk.com/hudson/job/answers/14/" target="_blank"&gt;answers&lt;/A&gt;&lt;/B&gt;&lt;B&gt;Previous Job:&lt;/B&gt;&lt;B&gt;Started by &lt;A href="https://community.splunk.com/hudson/job/answers/8/" target="_blank"&gt;answers #8&lt;/A&gt;&lt;/B&gt;&lt;B&gt;Build host:&lt;/B&gt;&lt;B&gt;Built on &lt;A href="https://community.splunk.com/hudson/computer/rhel6/" target="_blank"&gt;rhel6&lt;/A&gt;&lt;/B&gt;"}], "id": "2015-04-28_17-19-44", "keepLog": false, "url": "&lt;A href="http://thefactory.xyz.com:9999/jenkins/job/answers/13/" target="_blank"&gt;http://thefactory.xyz.com:9999/jenkins/job/answers/13/&lt;/A&gt;", "culprits": [], "result": "SUCCESS", "executor": null, "duration": 377658, "fullDisplayName": "answers", "estimatedDuration": 298415}&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This is just one line. The entire splunk-logged file is a json dump. now I need to extract the time from either the &lt;STRONG&gt;'ID' field or the 'timestamp' field&lt;/STRONG&gt;. Will the same props work for these? (I tried it didn't). My ultimate aim is to have the logs logged in that timestamp (2015-04-28 in this case) instead of when I create this logs. Any help will be largely useful....&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:42:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164913#M33442</guid>
      <dc:creator>hvaithia</dc:creator>
      <dc:date>2020-09-28T19:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164914#M33443</link>
      <description>&lt;P&gt;Thanks for the quick response. I think its my bad to have described my logs in part. But my actual logs look like below&lt;/P&gt;

&lt;P&gt;{"building": false, "changeSet": {"items": [], "kind": null}, "builtOn": "rhel6", "description": null, "artifacts": [], "timestamp": 1430241584496, "number": 13, "actions": [{"causes": [{"upstreamBuild": 14, "shortDescription": "Started by upstream project \"answers\" build number 14", "upstreamProject": "answers", "upstreamUrl": "job/answers/"}]}, {}, {}, {}, {}, {"highlightsData": "[{\"Previous Job\":\"answers#14\"},{\"Previous Job\":\"answers_se\"},{\"Build host\":\"rhel6\"}]", "highlightsTable": "&lt;/P&gt;&lt;H4&gt;Global Patterns&lt;/H4&gt;&lt;B&gt;Previous Job:&lt;/B&gt;&lt;B&gt;Started by &lt;A href="https://community.splunk.com/hudson/job/answers/14/" target="_blank"&gt;answers&lt;/A&gt;&lt;/B&gt;&lt;B&gt;Previous Job:&lt;/B&gt;&lt;B&gt;Started by &lt;A href="https://community.splunk.com/hudson/job/answers/8/" target="_blank"&gt;answers #8&lt;/A&gt;&lt;/B&gt;&lt;B&gt;Build host:&lt;/B&gt;&lt;B&gt;Built on &lt;A href="https://community.splunk.com/hudson/computer/rhel6/" target="_blank"&gt;rhel6&lt;/A&gt;&lt;/B&gt;"}], "id": "2015-04-28_17-19-44", "keepLog": false, "url": "&lt;A href="http://thefactory.xyz.com:9999/jenkins/job/answers/13/" target="_blank"&gt;http://thefactory.xyz.com:9999/jenkins/job/answers/13/&lt;/A&gt;", "culprits": [], "result": "SUCCESS", "executor": null, "duration": 377658, "fullDisplayName": "answers", "estimatedDuration": 298415}&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This is just one line. The entire splunk-logged file is a json dump. now I need to extract the time from either the &lt;STRONG&gt;'ID' field or the 'timestamp' field&lt;/STRONG&gt;. Will the same props work for these? (I tried it didn't). My ultimate aim is to have the logs logged in that timestamp (2015-04-28 in this case) instead of when I create this logs. Any help will be largely useful....&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:42:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164914#M33443</guid>
      <dc:creator>hvaithia</dc:creator>
      <dc:date>2020-09-28T19:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164915#M33444</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD = 512
TIME_PREFIX  = \"id\"\: \"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should capture the "id": " group, assuming this is the only id string in the event. You also should look at adjusting the lookahead depending on how far into the event the timestamp is..&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 23:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164915#M33444</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-04-28T23:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164916#M33445</link>
      <description>&lt;P&gt;[json_no_timestamp]&lt;BR /&gt;
TIME_PREFIX=^\"id\":\s\"&lt;BR /&gt;
TIME_FORMAT=%Y-%m-%d_%H-%M-%S&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 1048&lt;/P&gt;

&lt;P&gt;Here is my updated props. I tried 512 and 1048 for timestamp look ahead, but its still logging the time when I create the log with my script. It's still not taking the time from the ID parameter. &lt;/P&gt;

&lt;P&gt;Setting the lookahead will make splunk to look that many number of characters for the timestamp in every line. Did I get it right? I was wondering if I could match the 'timestamp' and deduce time with the epoch time if possible instead of getting it from 'id' field. Can you tell me how I can convert my epoch timestamp into something recognizable by splunk.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:47:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164916#M33445</guid>
      <dc:creator>hvaithia</dc:creator>
      <dc:date>2020-09-28T19:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164917#M33446</link>
      <description>&lt;P&gt;Also tried &lt;BR /&gt;
[json_no_timestamp]&lt;BR /&gt;
TIME_PREFIX="timestamp":&lt;BR /&gt;
TIME_FORMAT=%s%3N&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 512&lt;/P&gt;

&lt;P&gt;still nothing!!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164917#M33446</guid>
      <dc:creator>hvaithia</dc:creator>
      <dc:date>2020-09-28T19:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164918#M33447</link>
      <description>&lt;P&gt;Thanks to Stephen and esix for their help on this. Really appreciate it. This is what worked for me finally&lt;BR /&gt;
[json_timestamp]&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
TIME_FORMAT = %s%3N&lt;/P&gt;

&lt;H1&gt;TIMESTAMP_FIELDS = timestamp&lt;/H1&gt;

&lt;P&gt;TIME_PREFIX = timestamp&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
description = JavaScript Object Notation&lt;BR /&gt;
category = Structured&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;/P&gt;

&lt;P&gt;TIMESTAMP_FIELDS didn't unfortunately work with the forwarder (although it worked in the data preview)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164918#M33447</guid>
      <dc:creator>hvaithia</dc:creator>
      <dc:date>2020-09-28T19:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my props.conf for proper timestamp extraction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164919#M33448</link>
      <description>&lt;P&gt;when people provide useful information, please upvote them! i accepted your answer, since you provided what worked. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2015 20:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-edit-my-props-conf-for-proper-timestamp-extraction/m-p/164919#M33448</guid>
      <dc:creator>piebob</dc:creator>
      <dc:date>2015-05-01T20:00:23Z</dc:date>
    </item>
  </channel>
</rss>

