<?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: Why is my datetime.xml configuration not extracting two separate timestamp formats from a single log file? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-datetime-xml-configuration-not-extracting-two-separate/m-p/193468#M38576</link>
    <description>&lt;P&gt;Hi in my log event and filename date is not present i want give a fix date to log so what is do ?&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2015 05:44:45 GMT</pubDate>
    <dc:creator>nitesh218ss</dc:creator>
    <dc:date>2015-05-12T05:44:45Z</dc:date>
    <item>
      <title>Why is my datetime.xml configuration not extracting two separate timestamp formats from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-datetime-xml-configuration-not-extracting-two-separate/m-p/193466#M38574</link>
      <description>&lt;P&gt;I am trying to extract two separate timestamp formats from a single log file.  Here is a sample of the logfile:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[16 Mar 23:33:49.967] INFO com.hp.exstream.cc.server.core.phase.ExternalProgramPhase:pool-15-thread-14  - (See the entire program output in the file [var/jobs/5127/java.155941.out].)
[16 Mar 23:33:49.967] INFO com.hp.exstream.cc.server.core.phase.ExternalProgramPhase:pool-15-thread-14  - External program finished OK with return code [0].
[16 Mar 23:33:50.012] INFO com.hp.exstream.cc.server.core.job.JobDriver:pool-15-thread-14   - Execution of [SFTP to OPC] phase finished successfully.
[16 Mar 23:33:50.042] INFO com.hp.exstream.cc.server.core.job.JobDriver:pool-15-thread-14   - Starting execution of [SFTP hal to OPC] phase.
[16 Mar 23:33:50.044] INFO com.hp.exstream.cc.server.core.phase.ExternalProgramPhase:pool-15-thread-14  - Executing program [java] with arguments [-jar /opt/hp/ccdm/delivery-manager-2.3.0/command-center-2.3.0/lib/java/CCDeliveryClient.jar -c sftp -t put -u USWPLA  -p PLA2014highway -v cachi1-bh001.amer.zurich.corp -n 22 -l /opt/hp/ccdm/delivery-manager-2.3.0/command-center-2.3.0/var/jobs/5127 -r /PROD/PLA -x *.hal] in directory [/opt/hp/ccdm/delivery-manager-2.3.0/command-center-2.3.0/var/jobs/5127].
[16 Mar 23:33:56.121] INFO com.hp.exstream.cc.server.core.phase.ExternalProgramPhase:pool-15-thread-14  - Program output: 
(last 1024 chars) ... ession - is present.  The value is: *.hal
[INFO ]20150316@23:33:50,496:com.hpexstream.client.Sftp - Start FTP process.
[DEBUG]20150316@23:33:50,502:com.hpexstream.util.Find - Use file filter: WildcardFileFilter(*.hal)
[DEBUG]20150316@23:33:50,803:com.hpexstream.util.Find - Found file: VI0H150316.hal
[DEBUG]20150316@23:33:50,803:com.hpexstream.util.Find - Found file: VT0H150316.hal
[INFO ]20150316@23:33:50,803:com.hpexstream.client.Sftp - Found files count: 2
[INFO ]20150316@23:33:51,877:com.hpexstream.client.Sftp - Open SFTP channel
[INFO ]20150316@23:33:51,877:com.hpexstream.client.Sftp - Put local file: /opt/hp/ccdm/delivery-manager-2.3.0/command-center-2.3.0/var/jobs/5127/VI0H150316.hal to remote file: /PROD/PLA/VI0H150316.hal
[INFO ]20150316@23:33:55,694:com.hpexstream.client.Sftp - Put local file: /opt/hp/ccdm/delivery-manager-2.3.0/command-center-2.3.0/var/jobs/5127/VT0H150316.hal to remote file: /PROD/PLA/VT0H150316.hal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My props.conf looks like the below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[datetime]
DATETIME_CONFIG = D:\Program Files\SplunkUniversalForwarder\etc\apps\FORMS\local\datetime.xml
LINE_BREAKER = ([\r\n])+(?=(\[\d{2}\s(\w{3})\s(\d{2}):(\d{2}):(\d{2}).(\d{3})]|\[(\d{4})(\d{2})(\d{2})@(\d{2}):(\d{2}):(\d{2})\,(\d{3})\]))
SHOULD_LINEMERGE=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is my datetime.xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\[\d{2}\s(\w{3})\s(\d{2}):(\d{2}):(\d{2}).(\d{3})\]

\[(\d{4})(\d{2})(\d{2})@(\d{2}):(\d{2}):(\d{2})\,(\d{3})\]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Mar 2015 13:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-datetime-xml-configuration-not-extracting-two-separate/m-p/193466#M38574</guid>
      <dc:creator>mookiie2005</dc:creator>
      <dc:date>2015-03-24T13:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my datetime.xml configuration not extracting two separate timestamp formats from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-datetime-xml-configuration-not-extracting-two-separate/m-p/193467#M38575</link>
      <description>&lt;P&gt;The problem is that you have square brackets around the date in your second format. Here is what you probably should have in your &lt;CODE&gt;datetime.xml&lt;/CODE&gt; file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datetime&amp;gt;
&amp;lt;define name="_mydatetimeformat1" extract="day, month, hour, minute, second, subsecond"&amp;gt;
    &amp;lt;text&amp;gt;\[\d{2}\s(\w{3})\s(\d{2}):(\d{2}):(\d{2}).(\d{3})\]&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;define name="_mydatetimeformat2" extract="year, month, day, hour, minute, second, subsecond"&amp;gt;
     &amp;lt;text&amp;gt;(\d{4})(\d{2})(\d{2})@(\d{2}):(\d{2}):(\d{2})\,(\d{3})&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;timePatterns&amp;gt;
     &amp;lt;use name="_mydatetimeformat1"/&amp;gt;
     &amp;lt;use name="_mydatetimeformat2"/&amp;gt;
&amp;lt;/timePatterns&amp;gt;
&amp;lt;datePatterns&amp;gt;
     &amp;lt;use name="_mydatetimeformat1"/&amp;gt;
     &amp;lt;use name="_mydatetimeformat2"/&amp;gt;
&amp;lt;/datePatterns&amp;gt;
&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think you may have a problem not having a year in the first date format.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 02:53:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-datetime-xml-configuration-not-extracting-two-separate/m-p/193467#M38575</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2015-03-25T02:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my datetime.xml configuration not extracting two separate timestamp formats from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-datetime-xml-configuration-not-extracting-two-separate/m-p/193468#M38576</link>
      <description>&lt;P&gt;Hi in my log event and filename date is not present i want give a fix date to log so what is do ?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 05:44:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-datetime-xml-configuration-not-extracting-two-separate/m-p/193468#M38576</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-12T05:44:45Z</dc:date>
    </item>
  </channel>
</rss>

