<?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: vmware esxlog and datetime parsing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/vmware-esxlog-and-datetime-parsing/m-p/501625#M85478</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;[ esx ]
CHARSET=UTF-8
SHOULD_LINEMERGE=false
disabled=false
TIME_FORMAT=%FT%T.%3QZ
TIME_PREFIX=\w{4,}\s
LINE_BREAKER=([\r\n]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; is &lt;CODE&gt;hostname&lt;/CODE&gt; ,your real hostname is with  [^A-z0-9_]+, change REGEX.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.splunk.com/skins/images/AB5A2AECCF16BFE0405068565746F78A/responsive_peak/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Mar 2020 05:39:40 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-03-28T05:39:40Z</dc:date>
    <item>
      <title>vmware esxlog and datetime parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/vmware-esxlog-and-datetime-parsing/m-p/501624#M85477</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have trouble to parse the timestamp of ESX-logs.&lt;/P&gt;

&lt;P&gt;The esx-syslog:&lt;BR /&gt;
Mar 18 21:15:02 hostname 2020-03-18T20:15:02.109Z hostname   hostd-probe: info hostd-probe[FFA22350]&lt;BR /&gt;
and antoher log:&lt;BR /&gt;
Mar 18 21:15:02 hostname 2020-03-18T20:15:02Z hostname   hostd-probe: info hostd-probe[FFA22350]&lt;/P&gt;

&lt;P&gt;Because of some special multiline log I cut with SEDCMD the trailing splunk date "Mar 18 21:15:02". But this is done at the end of the parsing phase during indexing. So splunk tries first to read the date from the whole log. There are two formats, I like to have the date with milliseconds. &lt;/P&gt;

&lt;P&gt;Problems: the timezone is not recognized! I have an offset from 1 or 2 hours. And the milliseconds are not extracted.&lt;/P&gt;

&lt;P&gt;I tried:&lt;BR /&gt;
-  TZ = UTC&lt;BR /&gt;
   TIME_FORMAT=%Y-%m-%dT%H:%M:%S.%3N&lt;BR /&gt;
  -&amp;gt; does not work (maybe the T in the format string is not valid)&lt;BR /&gt;
- added some lines in datetime.xml and referenced it with DATETIME_CONFIG  in props.conf (checked with btool )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;define name="_time_without_zone" extract="hour, minute, second, subsecond"&amp;gt;
      &amp;lt;text&amp;gt;&amp;lt;![CDATA[(?&amp;lt;=T)]]&amp;gt;&amp;lt;/text&amp;gt;
            &amp;lt;use name="_hour"/&amp;gt;
      &amp;lt;text&amp;gt;&amp;lt;![CDATA[:]]&amp;gt;&amp;lt;/text&amp;gt;
            &amp;lt;use name="_minute"/&amp;gt;
      &amp;lt;text&amp;gt;&amp;lt;![CDATA[:]]&amp;gt;&amp;lt;/text&amp;gt;
            &amp;lt;use name="_second"/&amp;gt;
      &amp;lt;text&amp;gt;&amp;lt;![CDATA[(?:(?: \d{4})?[:,\.](\d+))? {0,2}]]&amp;gt;&amp;lt;/text&amp;gt;
    &amp;lt;/define&amp;gt;
&amp;lt;timePatterns&amp;gt;
      &amp;lt;use name="_time_without_zone"/&amp;gt;
      &amp;lt;use name="_time"/&amp;gt;
      &amp;lt;use name="_time_without_subsec"/&amp;gt;
      &amp;lt;use name="_time_no_sub"/&amp;gt;
      &amp;lt;use name="_time_esxi_4x"/&amp;gt;
      &amp;lt;!-- Uncomment the below comments if ESX 4 exists in the environment
      &amp;lt;use name="_time_esx_4x"/&amp;gt; --&amp;gt;
&amp;lt;/timePatterns&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;SO how can I extract the correct date and timezone?&lt;/P&gt;

&lt;P&gt;Torsten&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/vmware-esxlog-and-datetime-parsing/m-p/501624#M85477</guid>
      <dc:creator>tfechner</dc:creator>
      <dc:date>2020-09-30T04:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: vmware esxlog and datetime parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/vmware-esxlog-and-datetime-parsing/m-p/501625#M85478</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;[ esx ]
CHARSET=UTF-8
SHOULD_LINEMERGE=false
disabled=false
TIME_FORMAT=%FT%T.%3QZ
TIME_PREFIX=\w{4,}\s
LINE_BREAKER=([\r\n]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; is &lt;CODE&gt;hostname&lt;/CODE&gt; ,your real hostname is with  [^A-z0-9_]+, change REGEX.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.splunk.com/skins/images/AB5A2AECCF16BFE0405068565746F78A/responsive_peak/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 05:39:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/vmware-esxlog-and-datetime-parsing/m-p/501625#M85478</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-28T05:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: vmware esxlog and datetime parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/vmware-esxlog-and-datetime-parsing/m-p/501626#M85479</link>
      <description>&lt;P&gt;works now - thank you.&lt;BR /&gt;
does splunk handle  %F and %T different than %H:%M....&lt;BR /&gt;
your props seems to be very similar to mine.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 09:34:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/vmware-esxlog-and-datetime-parsing/m-p/501626#M85479</guid>
      <dc:creator>tfechner</dc:creator>
      <dc:date>2020-03-31T09:34:19Z</dc:date>
    </item>
  </channel>
</rss>

