<?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 Dealing with bizarre embedded timestamp in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89205#M22890</link>
    <description>&lt;P&gt;Hey everyone. Right now I'm dealing with some CSV files that are set up in the following format:
line 1: version header
line 2: header start message
line 3-N: interesting messages
line N+1: footer end message&lt;/P&gt;

&lt;P&gt;The first element in each line contains a record ID. The record ID is actually composed of numerous fields, including the timestamp, put together to create a unique record ID. Here's the format:&lt;/P&gt;

&lt;P&gt;Event Counter number (NOT zero padded), System ID, Date, and Time Zone &lt;/P&gt;

&lt;P&gt;Examples:&lt;/P&gt;

&lt;P&gt;Event 4, System ID 84732570, Date 12/22/2008 14:34:44.5390, and EST &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;48473257020081222143444.5390-050000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Event 10, System ID 84732570, Date 12/22/2008 14:35:22.4580, and EST&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;108473257020081222143522.4580-050000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Issues:
I can get the full date/time field with the following regex:
(([0-9]{14}).([0-9]{4}))
How do I define that and use it to timestamp the events? Any help would be very appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2010 01:29:40 GMT</pubDate>
    <dc:creator>msarro</dc:creator>
    <dc:date>2010-11-16T01:29:40Z</dc:date>
    <item>
      <title>Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89205#M22890</link>
      <description>&lt;P&gt;Hey everyone. Right now I'm dealing with some CSV files that are set up in the following format:
line 1: version header
line 2: header start message
line 3-N: interesting messages
line N+1: footer end message&lt;/P&gt;

&lt;P&gt;The first element in each line contains a record ID. The record ID is actually composed of numerous fields, including the timestamp, put together to create a unique record ID. Here's the format:&lt;/P&gt;

&lt;P&gt;Event Counter number (NOT zero padded), System ID, Date, and Time Zone &lt;/P&gt;

&lt;P&gt;Examples:&lt;/P&gt;

&lt;P&gt;Event 4, System ID 84732570, Date 12/22/2008 14:34:44.5390, and EST &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;48473257020081222143444.5390-050000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Event 10, System ID 84732570, Date 12/22/2008 14:35:22.4580, and EST&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;108473257020081222143522.4580-050000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Issues:
I can get the full date/time field with the following regex:
(([0-9]{14}).([0-9]{4}))
How do I define that and use it to timestamp the events? Any help would be very appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 01:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89205#M22890</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2010-11-16T01:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89206#M22891</link>
      <description>&lt;P&gt;Check this out: &lt;A href="http://www.splunk.com/base/Documentation/4.1.5/admin/ConfigurePositionalTimestampExtraction" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.5/admin/ConfigurePositionalTimestampExtraction&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Example: If an event looks like:

1989/12/31 16:00:00 ed May 23 15:40:21 2007 ERROR UserManager - Exception thrown Ignoring unsupported search for eventtype: /doc sourcetype="access_combined" NOT eventtypetag=bot

To identify the timestamp: May 23 15:40:21 2007 

[source::/Applications/splunk/var/spool/splunk]
TIME_PREFIX = \d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} \w+\s 
MAX_TIMESTAMP_LOOKAHEAD = 44
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then for this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Examples Event 4, System ID 84732570, Date 12/22/2008 14:34:44.5390, and EST 48473257020081222143444.5390-050000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you might want to use &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = .*\,\s\Date\s 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which will capture "Examples Event 4, System ID 84732570, Date " as the time prefix and use 12/22/2008 for your event..&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 02:45:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89206#M22891</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-11-16T02:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89207#M22892</link>
      <description>&lt;P&gt;My apologies, the event 4/system ID stuff was just to denote the upcoming example and explain what each of the items were. All the file has inside of it is the numeric timestamp in this form. I don't think position will work since the event id isn't 0 padded, and therefore can be any length which would destroy using count as an option.&lt;/P&gt;

&lt;P&gt;Each row is started with a field like this, no header:&lt;BR /&gt;
48473257020081222143444.5390-050000&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 02:52:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89207#M22892</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2010-11-16T02:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89208#M22893</link>
      <description>&lt;P&gt;48473257020081222143444.5390-050000 and 108473257020081222143522.4580-050000 How many different other events are there, do they all have Eventnumber (4 or 10) followed by the "84732570" numbers? or are these all different? Can you paste a larger sample of these events for example? Reason i ask is you can use same idea of the time_prefix to use this...&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 04:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89208#M22893</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-11-16T04:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89209#M22894</link>
      <description>&lt;P&gt;in other words is the system id always the same? – Genti♦ 0 secs ago&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 04:27:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89209#M22894</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-11-16T04:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89210#M22895</link>
      <description>&lt;P&gt;The event ID is a counter, so it could be 1, all the way up to infinity (theoretically). It resets to 0 every N minutes (where n is the duration of the logging period for the file). The system ID is the same because these are all coming from one device, however in production there will be several devices (their ID's should remain the same though).&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 04:50:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89210#M22895</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2010-11-16T04:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89211#M22896</link>
      <description>&lt;P&gt;Further examples:&lt;BR /&gt;
13868473257020081222195315.8980-050000 48473257020081222143444.5390-050000 128473257020081222143522.6560-050000 48908473257020081223192836.2420-050000&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 04:59:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89211#M22896</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2010-11-16T04:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89212#M22897</link>
      <description>&lt;P&gt;This is quite an ugly timestamp!  Who wrote this software?  Was it designed to be consumed by androids from the future?&lt;/P&gt;

&lt;P&gt;The following should solve your problem.  I am assuming that this record string is at the beginning of the event - if not, you will need to remove the carat and perhaps change the lookahead.  I am also assuming that the month, day, and time will always be the same number of characters.&lt;/P&gt;

&lt;P&gt;$SPLUNK_HOME/etc/system/local/props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
TIME_PREFIX=^\d+(?=\d{14}\.)
TIME_FORMAT=%Y%m%d%H%M%S.%q%Z
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Nov 2010 05:03:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89212#M22897</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2010-11-16T05:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89213#M22898</link>
      <description>&lt;P&gt;thanks for this TIME_PREFIX=^\d+(?=\d{14}.) , Alex!!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 05:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89213#M22898</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-11-16T05:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89214#M22899</link>
      <description>&lt;P&gt;Thanks for your post! The month, day, and time will always be the same number of characters, however they're not at the front of the record. For example in 108473257020081222143522.4580-050000, the date doesn't start until 20081222143522.4580-050000. The records are supposed to look weird, they're being used to act as unique record ID's so they concantenate 4 different fields together. I tried the script as mentioned and am not having a lot of luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I'll keep working on it tomorrow.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 06:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89214#M22899</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2010-11-16T06:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89215#M22900</link>
      <description>&lt;P&gt;Sorry I meant that I am assuming that the record string is at the beginning of the event, not the timestamp itself.  Make sure that you have applied the correct sourcetype and that you have done it on the Splunk instance that is parsing the data.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 08:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89215#M22900</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2010-11-16T08:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with bizarre embedded timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89216#M22901</link>
      <description>&lt;P&gt;I ended up resolving this today. I tried to get the prior solution to work however it wasn't quite functioning. After a closer look at the data that was coming in, there was another start time field that I could use. I verified that it matched the time in the event ID. Then I simply created a prefix which skipped x fields in (in this case, x=8). Here's how things look in my props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[AS_CDR]
TIME_PREFIX=(?i)^(?:[^,]*,){8}(?P&amp;lt;FIELDNAME&amp;gt;[^,]+)
TIME_FORMAT=%Y%m%d%H%M%S.%q%Z
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Nov 2010 05:11:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dealing-with-bizarre-embedded-timestamp/m-p/89216#M22901</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2010-11-18T05:11:56Z</dc:date>
    </item>
  </channel>
</rss>

