<?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 a timestamp from an event with bracket characters? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418600#M73835</link>
    <description>&lt;P&gt;@blaise Please accept an answer to help future readers.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 13:44:55 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-12-05T13:44:55Z</dc:date>
    <item>
      <title>How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418590#M73825</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;

&lt;P&gt;I am trying to extract a timestamp from this type of events. Here, 04 is the day of month and 12 is the month, Dec&lt;BR /&gt;
on the search head, these events currently appear as 12th April&lt;BR /&gt;
[04/12/2018 10:16:04]      CAUAJM_I_40245 EVENT: CHANGE_STATUS    STATUS: SUCCESS         JOB: esysprod_NOA_5_min_box&lt;BR /&gt;
[04/12/2018 10:26:03]      CAUAJM_I_40245 EVENT: CHANGE_STATUS    STATUS: SUCCESS         JOB: esysprod_EX900  MACHINE: &lt;/P&gt;

&lt;P&gt;It looks pretty straightforward, but I cannot figure out what I am doing wrong.&lt;/P&gt;

&lt;P&gt;The source type for these events is called : "autosys_events_prod"&lt;/P&gt;

&lt;P&gt;So, I created a props.conf as below, and located it in the app that gets distributed from my deployment server:&lt;BR /&gt;
I also verify on the server where the log is created that the props.conf file is updated, and I also restart Splunk on the Universal Forwarder.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[splunk@msplunkutil01 local]$ cat props.conf

[autosys_events_prod]
TIME_PREFIX = ^[
TIME_FORMAT = %d/%m/%Y %H:%M:%S
SHOULD_LINEMERGE = false
MAX_TIMESTAMP_LOOKAHEAD = 19
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried different time prefix(es) without success.&lt;/P&gt;

&lt;P&gt;How do I know if my props.conf is actually being used?&lt;/P&gt;

&lt;P&gt;Everything I have tried seems to have no effect so far.&lt;/P&gt;

&lt;P&gt;What is the best way to troubleshoot this ?&lt;/P&gt;

&lt;P&gt;Thank you for your help in advance.&lt;/P&gt;

&lt;P&gt;it is the first time I am trying to extract a timestamp from an event, so I might be doing something wrong.&lt;/P&gt;

&lt;P&gt;Blaise&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418590#M73825</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2020-09-29T22:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418591#M73826</link>
      <description>&lt;P&gt;&lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; is a regular expression, but yours is not a valid regex.  &lt;CODE&gt;^[&lt;/CODE&gt; starts a character set, but doesn't finish it.  Try `^[', which treats the bracket as a literal character.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 03:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418591#M73826</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-12-04T03:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418592#M73827</link>
      <description>&lt;P&gt;Hi Rich&lt;BR /&gt;
I have tried your suggestion and it still is showing events for the 12th April, instead of the 4th Dec&lt;BR /&gt;
I tried those 2:&lt;BR /&gt;
TIME_PREFIX = '^['&lt;BR /&gt;
TIME_PREFIX = '['&lt;/P&gt;

&lt;P&gt;to confirm my props setttings on the universal forwarder, I found this great command:&lt;BR /&gt;
[splunk@bautoprod01 local]$ splunk cmd btool --app=autosys props list&lt;BR /&gt;
[autosys_events_prod]&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 19&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
TIME_FORMAT = %d/%m/%Y %H:%M:%S&lt;BR /&gt;
TIME_PREFIX = '['&lt;BR /&gt;
[splunk@bautoprod01 local]$ pwd&lt;BR /&gt;
/opt/splunkforwarder/etc/apps/autosys/local&lt;BR /&gt;
[splunk@bautoprod01 local]$&lt;/P&gt;

&lt;P&gt;So the above confirms that the settings are applied ("distributed"), but yet it still is not working&lt;BR /&gt;
Thank you for your help anyway&lt;BR /&gt;
Blaise&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:15:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418592#M73827</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2020-09-29T22:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418593#M73828</link>
      <description>&lt;P&gt;Change &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; to &lt;CODE&gt;%m/%d/%Y %H:%M:%S&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 12:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418593#M73828</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-12-04T12:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418594#M73829</link>
      <description>&lt;P&gt;This should work, give it a try....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[autosys_events_prod]
SHOULD_LINEMERGE = false
TIME_PREFIX = ^\[
TIME_FORMAT = %m/%d/%Y %H:%M:%S
MAX_TIMESTAMP_LOOKAHEAD = 19
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 19:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418594#M73829</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2018-12-04T19:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418595#M73830</link>
      <description>&lt;P&gt;Hi Rich and Prakash&lt;BR /&gt;
I have tried both suggestions and it still is not working&lt;/P&gt;

&lt;P&gt;thank you both for your replies, you both suggested to use : &lt;BR /&gt;
 TIME_FORMAT to %m/%d/%Y %H:%M:%S&lt;BR /&gt;
but my raw events timestamps shows as : [05/12/2018 10:32:03]   text text ...&lt;BR /&gt;
where 05 is the day of the month   %d&lt;BR /&gt;
and 12 is the month  %m&lt;BR /&gt;
so the correct TIME FORMAT should be : %d/%m/%Y %H:%M:%S&lt;BR /&gt;
please explain why you suggested otherwise, I am getting really confused ... &lt;/P&gt;

&lt;P&gt;I am also wondering why all my attempts are failing, is it possible that another definition or config somewhere could take precedence over the app's props.conf ?&lt;BR /&gt;
Thank you again&lt;BR /&gt;
Blaise&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 23:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418595#M73830</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2018-12-04T23:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418596#M73831</link>
      <description>&lt;P&gt;@blaise, I originally recommended &lt;CODE&gt;%d/%m/%Y %H:%M:%S&lt;/CODE&gt;, but you said it was wrong so I suggested &lt;CODE&gt;%m/%d/%Y %H:%M:%S&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 01:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418596#M73831</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-12-05T01:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418597#M73832</link>
      <description>&lt;P&gt;@blaise: I tested it on my local with your sample data, it's working for me, except you need to make changes to TIME_FORMAT based on your requirements...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ##this configs should be on indexers(data parsing happens on indexers)
 props.conf
 [autosys_events_prod]
 SHOULD_LINEMERGE = false
 TIME_PREFIX = ^\[
 TIME_FORMAT = %d/%m/%Y %H:%M:%S
 MAX_TIMESTAMP_LOOKAHEAD = 19

 try running this command to check all the props in that particular app...

 ./splunk btool props list --debug 
 ./splunk btool props list --debug --app=search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Dec 2018 03:57:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418597#M73832</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2018-12-05T03:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418598#M73833</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
I have finally resolved the issue, the problem was I have a distributed environment ...&lt;BR /&gt;
so like Prakash suggested, the props.conf needs to be on the indexers, where the timestamp extraction is done.&lt;BR /&gt;
I have completely removed the props.conf from the universal forwarder server, where I only left the inputs.conf to define the inputs.&lt;BR /&gt;
Thank you for all your help&lt;BR /&gt;
Blaise&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 05:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418598#M73833</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2018-12-05T05:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418599#M73834</link>
      <description>&lt;P&gt;Hi Prakash,&lt;BR /&gt;
thank you , you are correct and that was my mistake, the props.conf definition needs to be on the indexers.&lt;BR /&gt;
Once I did that , it started working&lt;BR /&gt;
Thank you heaps for your help, it is appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Blaise&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 05:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418599#M73834</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2018-12-05T05:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a timestamp from an event with bracket characters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418600#M73835</link>
      <description>&lt;P&gt;@blaise Please accept an answer to help future readers.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 13:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-a-timestamp-from-an-event-with-bracket/m-p/418600#M73835</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-12-05T13:44:55Z</dc:date>
    </item>
  </channel>
</rss>

