<?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: TIME_PREFIX in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/TIME-PREFIX/m-p/153106#M185601</link>
    <description>&lt;P&gt;Well &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; is used to ensure that you find the start of the timestamp in the events, whereas &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; will allow you to specify how the timstamp is formatted. &lt;/P&gt;

&lt;P&gt;In your case, you seem to be having three different time formats, but the first seems to be of less interest (service started?). The second two differ very little, and if you can make do without the millisecond precision, you could probably have something like this config (in props.conf);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
MAX_TIMESTAMP_LOOKAHEAD = 50
TIME_FORMAT = %Y-%m-%d %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Unfortunately, TIME_FORMAT does not take a regex as parameter value, otherwise it would have been easy to handle the dot/comma difference.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;Perhaps you could also add the &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; as such;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = (:\s|&amp;lt;|^)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; will match the first instance it finds of the pattern, and will start looking for a timestamp immediately after it (which must be formatted according to the &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Not sure it will have any success on the first message. &lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2014 14:49:51 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2014-02-17T14:49:51Z</dc:date>
    <item>
      <title>TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TIME-PREFIX/m-p/153105#M185600</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I have a log-file with diffrent time formats.&lt;BR /&gt;
Is it possible to extract this diffrent timestamps with TIME_PREFIX in propts.conf?&lt;BR /&gt;
Loglines:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Feb 17, 2014 8:32:42 AM CET&amp;gt; &amp;lt;Notice&amp;gt; &amp;lt;WebLogicServer&amp;gt; &amp;lt;BEA-000365&amp;gt; &amp;lt;Server state changed to STARTING&amp;gt; 
[EL Finest]: 2014-02-17 08:32:45.961--ServerSession(998916174)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level.sql; value=FINEST; translated value=FINEST
[EL Finer]: 2014-02-17 08:32:45.973--ServerSession(998916174)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Searching for default mapping file in file:/opt/user_projects/domains/tdapp12/servers/tsapp12maportal01/tmp/_WL_user/clientportal/a7daku/APP-INF/lib/sympany.clientportal.jpa.jar
[EL Config]: 2014-02-17 08:32:45.982--ServerSession(998916174)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The access type for the persistent class [class ch.sympany.clientportal.model.UserPreferences] is set to [FIELD].
2014-02-17 08:32:54,248 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG ch.sympany.clientportal.servlet.StartupServletContextListener  - StartupServletContextListener initialised.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Feb 2014 13:17:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TIME-PREFIX/m-p/153105#M185600</guid>
      <dc:creator>surfjose</dc:creator>
      <dc:date>2014-02-17T13:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TIME-PREFIX/m-p/153106#M185601</link>
      <description>&lt;P&gt;Well &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; is used to ensure that you find the start of the timestamp in the events, whereas &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; will allow you to specify how the timstamp is formatted. &lt;/P&gt;

&lt;P&gt;In your case, you seem to be having three different time formats, but the first seems to be of less interest (service started?). The second two differ very little, and if you can make do without the millisecond precision, you could probably have something like this config (in props.conf);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
MAX_TIMESTAMP_LOOKAHEAD = 50
TIME_FORMAT = %Y-%m-%d %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Unfortunately, TIME_FORMAT does not take a regex as parameter value, otherwise it would have been easy to handle the dot/comma difference.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;Perhaps you could also add the &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; as such;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = (:\s|&amp;lt;|^)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; will match the first instance it finds of the pattern, and will start looking for a timestamp immediately after it (which must be formatted according to the &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Not sure it will have any success on the first message. &lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2014 14:49:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TIME-PREFIX/m-p/153106#M185601</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-02-17T14:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TIME-PREFIX/m-p/153107#M185602</link>
      <description>&lt;P&gt;It does not work.&lt;BR /&gt;
It taks findes only the timestamp from this log entry:&lt;BR /&gt;
2014-02-17 08:32:54,248 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG ch.sympany.clientportal.servlet.StartupServletContextListener - StartupServletContextListener initialised.&lt;/P&gt;

&lt;P&gt;The best filter i have create is this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
MAX_TIMESTAMP_LOOKAHEAD = 50
TIME_PREFIX = \[EL Finest]:|\[EL Finer]:|\[EL Config]: |\&amp;lt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the result is not 100%.&lt;/P&gt;

&lt;P&gt;Any ideas in this way?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2014 15:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TIME-PREFIX/m-p/153107#M185602</guid>
      <dc:creator>surfjose</dc:creator>
      <dc:date>2014-02-17T15:18:34Z</dc:date>
    </item>
  </channel>
</rss>

