<?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: date_hour not present in WinEventLogs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78007#M19742</link>
    <description>&lt;P&gt;Kristian, this is not an answer but I can confirm that you should have a date_hour Field for your WinEventLogs.&lt;BR /&gt;
I'm guessing you have something interfering with your default field extractions.&lt;BR /&gt;
Can you upgrade to 4.2.3 on your Indexer?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2011 18:42:13 GMT</pubDate>
    <dc:creator>gekoner</dc:creator>
    <dc:date>2011-09-19T18:42:13Z</dc:date>
    <item>
      <title>date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78006#M19741</link>
      <description>&lt;P&gt;Trying to write a search that list events happening outside office hours, across a bunch of sourcetypes - however, the 'date_hour' is not available/reportable/searchable for Windows Event Logs. It just isn't there among the available fields.&lt;/P&gt;

&lt;P&gt;e.g. &lt;/P&gt;

&lt;P&gt;WORKS FINE:  &lt;CODE&gt;sourcetype=linuxsecure root (date_hour &amp;lt; 8 OR date_hour &amp;gt; 17)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;WORKS NOT: &lt;CODE&gt;sourcetype=wineventlog:security administrator (date_hour &amp;lt; 8 OR date_hour &amp;gt; 17)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The following search confirmed that &lt;CODE&gt;date_hour&lt;/CODE&gt; is not extracted for WinEventLogs, i.e. the &lt;CODE&gt;date_hour&lt;/CODE&gt; column is empty on the WinEventLog row.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;* | dedup sourcetype | table date_hour, sourcetype&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Is there something that could be done about this? It seems like the problem is within the way Splunk treats the WinEvt-logs, rather than something to be done at search time. &lt;/P&gt;

&lt;P&gt;The Docs only state that default fields, such as date_*, will be extracted only if the information is present within the event itself. When looking at Windows events, they sure do have timestamps in them. Any help or clarification appreciated.&lt;/P&gt;

&lt;P&gt;Running 4.2.1 on RH, forwarders are 4.2.2 on multiple OS's. Other events (various application logs) collected by Win-forwarders contain the date_* default fields....&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2011 16:22:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78006#M19741</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-09-19T16:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78007#M19742</link>
      <description>&lt;P&gt;Kristian, this is not an answer but I can confirm that you should have a date_hour Field for your WinEventLogs.&lt;BR /&gt;
I'm guessing you have something interfering with your default field extractions.&lt;BR /&gt;
Can you upgrade to 4.2.3 on your Indexer?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2011 18:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78007#M19742</guid>
      <dc:creator>gekoner</dc:creator>
      <dc:date>2011-09-19T18:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78008#M19743</link>
      <description>&lt;P&gt;Have not updated the RH splunk indexer yet, but I had a look at a couple of other Windows indexers, and date_hour was not available/extracted on either of them when fetching the logs through forwarders.&lt;/P&gt;

&lt;P&gt;One of the indexers was also fetching EventLogs through WMI, and on those the date_* fields were extracted. Anyone who can shed light on this?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2011 13:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78008#M19743</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-09-20T13:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78009#M19744</link>
      <description>&lt;P&gt;I just tested this on a Universal Forwarder v4.2.3 running on Windows 7 (Swedish language for what it's worth) forwarding to a v4.2.3 indexer on Ubuntu and can confirm that I'm not getting any date_* fields either. Normally this will happen if Splunk can't obtain a valid timestamp from an event, but I'm getting correct timestamps even for old events that were generated before I turned the log monitor on, so Splunk obviously finds and uses the timestamp.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2011 14:46:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78009#M19744</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-20T14:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78010#M19745</link>
      <description>&lt;P&gt;c,&lt;/P&gt;

&lt;P&gt;I'd say this behaviour is a bug, and you should file a case with support.&lt;/P&gt;

&lt;P&gt;That said, there are ways to work around it in the meantime by extracting the date_hour (and other) fields you need from _time instead by using &lt;CODE&gt;eval&lt;/CODE&gt; and &lt;CODE&gt;strftime&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=wineventlog:security administrator | eval date_hour=strftime(_time, "%H") | where (date_hour&amp;lt;8 OR date_hour&amp;gt;17)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I took the liberty to rewrite the condition using OR instead of AND, as &lt;CODE&gt;date_hour&amp;lt;8 AND date_hour&amp;gt;17&lt;/CODE&gt; will never match.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
&lt;BR /&gt;P&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2011 20:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78010#M19745</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-20T20:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78011#M19746</link>
      <description>&lt;P&gt;P! &lt;/P&gt;

&lt;P&gt;Thanks for pointing that one out. That's what happens when you copy someone elses code example code &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; The character validation was messing with my dangerous HTML characters, so I just copied somebody elses code example for searches WITHIN office hours - hence the reversed position of &amp;lt; and &amp;gt; (first edit) and the 'AND' (second edit) &lt;/P&gt;

&lt;P&gt;The problem still persists, and I will file a support case. &lt;/P&gt;

&lt;P&gt;c.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2011 21:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78011#M19746</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-09-20T21:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78012#M19747</link>
      <description>&lt;P&gt;I hope this is fixed soon.  WMI data sources are certainly critical enough that we should not have to resort to hacks like this.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2011 15:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78012#M19747</guid>
      <dc:creator>ehoward</dc:creator>
      <dc:date>2011-09-21T15:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78013#M19748</link>
      <description>&lt;P&gt;The word from the support team is that this is a known limitation of how Splunk treat the WinEventLogs when grabbed through a forwarder (even though the docs do not mention this). &lt;/P&gt;

&lt;P&gt;The suggested workaround is the same as Ayn mentioned;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;*| eval date_hour = strftime(_time, "%H")&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;although I suspect one could make a permanent field extraction if date_hour for WinEventLogs is needed in more than just a few places.&lt;/P&gt;

&lt;P&gt;Kristian &lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2011 09:05:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78013#M19748</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-09-22T09:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78014#M19749</link>
      <description>&lt;P&gt;I have not had any real experience with using WMI to fecth WinEventLogs, but the little I have seen indicates that the date_hour field is indeed extracted properly.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2011 09:08:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78014#M19749</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-09-22T09:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: date_hour not present in WinEventLogs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78015#M19750</link>
      <description>&lt;P&gt;The date_hour is a Splunk default field which have timestamp information in that as generated by their respective systems.  These fields come over unmodified.  the _time field is presented to the user the preferences for their local time zone for display purposes &lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Knowledge/Usedefaultfields" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Knowledge/Usedefaultfields&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;For example,&lt;/P&gt;

&lt;P&gt;Assuming the Windows Server is in Pacific Standard time, and the user(me) is in Eastern time.&lt;BR /&gt;&lt;BR /&gt;
if the event occurred on the server at 07:37AM PST, then my time will show 10:37AM EST&lt;/P&gt;

&lt;P&gt;So the code: *| eval date_hour = strftime(_time, "%H") will production the following output&lt;/P&gt;

&lt;P&gt;_time = 10:37 AM&lt;BR /&gt;
date_hour = 10&lt;BR /&gt;
actual event time (which I want to display) =  07:37AM&lt;/P&gt;

&lt;P&gt;So the code above merely shows the time value using the offset by the user.  I want to see 07 in the date_hour field, like I would if syslog sent a record.  The code does indeed create a date_hour field, but not the same date_hour which Splunk generates as a default field. &lt;/P&gt;

&lt;P&gt;the date_* fields are only missing for Windows Events. They are visible for F5, Netscaler, and Cisco. &lt;/P&gt;

&lt;P&gt;We have servers in all four time zones, and Hawaii. &lt;/P&gt;

&lt;P&gt;Splunk Support tells me this unfortunately: &lt;/P&gt;

&lt;P&gt;Unfortunately, the default date-time fields in Splunk doesn't work for Windows Event Logs as it uses API to ingest data rather the regular data ingestion pipeline.&lt;/P&gt;

&lt;P&gt;The link below explains default fields:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/Knowledge/Usedefaultfields" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/Knowledge/Usedefaultfields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-hour-not-present-in-WinEventLogs/m-p/78015#M19750</guid>
      <dc:creator>jaxjohnny2000</dc:creator>
      <dc:date>2020-09-30T00:50:45Z</dc:date>
    </item>
  </channel>
</rss>

