<?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: Read timezone from openvas logs? Regex, strftime, won't detect it. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/361000#M106666</link>
    <description>&lt;P&gt;The correct settings on your indexers would be this (in #props.conf):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = chars\s+pos\&amp;gt;
TIME_FORMAT = %Y-%m-%d %Hh%m.%S %Z:%N
MAX_TIMESTAMP_LOOKAHEAD = 29
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Apr 2018 22:42:10 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2018-04-24T22:42:10Z</dc:date>
    <item>
      <title>Read timezone from openvas logs? Regex, strftime, won't detect it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/360999#M106665</link>
      <description>&lt;P&gt;I'm inputting openvas logs into splunk. Works great for .messages, not so much for .log files. Below is how the lines look:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Info&amp;lt;18 chars pos&amp;gt;2018-04-23 23h04.55 utc:31730 SOME MESSAGE
Info&amp;lt;18 chars pos&amp;gt;2018-04-24 10h25.34 CDT:539 SOME MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, time zone starts at the 18 character. Splunk cannot read it no matter how far I go.&lt;/P&gt;

&lt;P&gt;Timestamp prefix regex:&lt;BR /&gt;
    ^.{18}\K&lt;BR /&gt;
I also tried the more pythonic way of doing this regex:&lt;BR /&gt;
    ^.{18}&lt;BR /&gt;
Still can't get it detected in splunk, so I added strftime:&lt;BR /&gt;
    %Y-%M-%d %Hh%M.%S %Z:%s&lt;/P&gt;

&lt;P&gt;Any ideas on how to get the timestamp recognized correctly in splunk?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 21:30:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/360999#M106665</guid>
      <dc:creator>JSkier</dc:creator>
      <dc:date>2018-04-24T21:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Read timezone from openvas logs? Regex, strftime, won't detect it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/361000#M106666</link>
      <description>&lt;P&gt;The correct settings on your indexers would be this (in #props.conf):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = chars\s+pos\&amp;gt;
TIME_FORMAT = %Y-%m-%d %Hh%m.%S %Z:%N
MAX_TIMESTAMP_LOOKAHEAD = 29
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 22:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/361000#M106666</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-24T22:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read timezone from openvas logs? Regex, strftime, won't detect it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/361001#M106667</link>
      <description>&lt;P&gt;Your mistake was using &lt;CODE&gt;%M&lt;/CODE&gt; twice; that is totally invalid.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 22:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/361001#M106667</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-24T22:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Read timezone from openvas logs? Regex, strftime, won't detect it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/361002#M106668</link>
      <description>&lt;P&gt;This got me on the right path, thank you!&lt;/P&gt;

&lt;P&gt;UPDATE: Removed %N, it is not actually seconds. &lt;BR /&gt;
UPDATE2: Turns out some timestamps start 19 chars in, I have updated the props below to reflect this. The log source timestamps are a mess (some local tz, others utc), splunk isn't able to differentiate them, so I removed the TZ from the format. It will require a few source types to get it to a very clean place.&lt;/P&gt;

&lt;P&gt;Timezone stuff is still weird, so it will need more tuning there on my end, but this ended up working for parsing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE = false
TIME_PREFIX = ^\w+\s{1,5}\w+:(\s+\w+|\w+):
TIME_FORMAT = %Y-%m-%d %Hh%M.%S
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Apr 2018 13:18:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Read-timezone-from-openvas-logs-Regex-strftime-won-t-detect-it/m-p/361002#M106668</guid>
      <dc:creator>JSkier</dc:creator>
      <dc:date>2018-04-25T13:18:07Z</dc:date>
    </item>
  </channel>
</rss>

