<?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: Specific Hour Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31591#M6547</link>
    <description>&lt;P&gt;Ended up using the following, for anyone interested. I just needed to put the carat in the CDATA string. Thanks guys!&lt;BR /&gt;
&lt;SEARCHTEMPLATE&gt;(index=windows_7 OR index=windows_2008_R2) source=wineventlog:security Process_Name="C:\Windows\System32\winlogon.exe" Logon_GUID!="{00000000-0000-0000-0000-000000000000}" host=$Computer$ user=$User$ | eval hour_of_the_day=strftime(_time,"%H") | where (hour_of_the_day &amp;gt;= 17 &amp;lt;![CDATA[or hour_of_the_day &amp;lt; 6]]&amp;gt;) | timechart count by user&lt;/SEARCHTEMPLATE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 11:42:44 GMT</pubDate>
    <dc:creator>jsb22</dc:creator>
    <dc:date>2020-09-28T11:42:44Z</dc:date>
    <item>
      <title>Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31584#M6540</link>
      <description>&lt;P&gt;Anyone know splunk's built-in time variables? For example, I'm trying to create a search based on events occuring after 5 PM and before 6 AM, but the "date_hour" or "day_hour" variables that I've seen in other posts don't seem to be working. Any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2012 23:06:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31584#M6540</guid>
      <dc:creator>jsb22</dc:creator>
      <dc:date>2012-04-19T23:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31585#M6541</link>
      <description>&lt;P&gt;Does something like this work for you :&lt;/P&gt;

&lt;P&gt;Simple example , add your specific fields to the table command as you require.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval hour_of_the_day=strftime(_time, "%H") | where hour_of_the_day &amp;gt;=17 or hour_of_the_day &amp;lt; 6 | table _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Apr 2012 01:15:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31585#M6541</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2012-04-20T01:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31586#M6542</link>
      <description>&lt;P&gt;Works in the search, but not forms. Unfortunately the less than comparator is being seen as part of an html tag in my form so I'm getting "Encountered the following error while trying to update: In handler 'views': Error parsing XML on line 47: StartTag: invalid element name" Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2012 11:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31586#M6542</guid>
      <dc:creator>jsb22</dc:creator>
      <dc:date>2012-04-20T11:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31587#M6543</link>
      <description>&lt;P&gt;When you're using "&amp;lt;" in a search command within an XML document, that tag character is interpreted as part of the XML data rather than as part of the search command. To specify that this tag is not referring to the XML structure, use the special escaping sequence &lt;CODE&gt;&amp;lt;![CDATA[&lt;/CODE&gt; and its corresponding end sequence &lt;CODE&gt;]]&amp;gt;&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;See this question and corresponding for more details: &lt;A href="http://splunk-base.splunk.com/answers/30157/inputlookup-in-view-with-rex"&gt;http://splunk-base.splunk.com/answers/30157/inputlookup-in-view-with-rex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2012 11:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31587#M6543</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-20T11:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31588#M6544</link>
      <description>&lt;P&gt;Thanks Ayn &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2012 11:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31588#M6544</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2012-04-20T11:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31589#M6545</link>
      <description>&lt;P&gt;Still not quite working. Ayn's response cleared the error, but it's not giving the results I would expect. Search line is as follows:&lt;/P&gt;

&lt;P&gt;&lt;SEARCHTEMPLATE&gt;(index=windows_7 OR index=windows_2008_R2) source=wineventlog:security Process_Name="C:\Windows\System32\winlogon.exe" Logon_GUID!="{00000000-0000-0000-0000-000000000000}" | eval hour_of_the_day=strftime(_time,"%H") | where (hour_of_the_day &amp;gt;= 17 or hour_of_the_day &amp;gt; &amp;lt;![CDATA[ 6) | timechart count by user]]&amp;gt;&lt;/SEARCHTEMPLATE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31589#M6545</guid>
      <dc:creator>jsb22</dc:creator>
      <dc:date>2020-09-28T11:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31590#M6546</link>
      <description>&lt;P&gt;Try wrapping the entire search in a CDATA block :&lt;/P&gt;

&lt;P&gt;&lt;SEARCHTEMPLATE&gt;&amp;lt;![CDATA[ (index=windows_7 OR index=windows_2008_R2) source=wineventlog:security Process_Name="C:\Windows\System32\winlogon.exe" Logon_GUID!="{00000000-0000-0000-0000-000000000000}" | eval hour_of_the_day=strftime(_time,"%H") | where hour_of_the_day &amp;gt;= 17 or hour_of_the_day &amp;gt;  6 | timechart count by user ]]&amp;gt;&lt;/SEARCHTEMPLATE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31590#M6546</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2020-09-28T11:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31591#M6547</link>
      <description>&lt;P&gt;Ended up using the following, for anyone interested. I just needed to put the carat in the CDATA string. Thanks guys!&lt;BR /&gt;
&lt;SEARCHTEMPLATE&gt;(index=windows_7 OR index=windows_2008_R2) source=wineventlog:security Process_Name="C:\Windows\System32\winlogon.exe" Logon_GUID!="{00000000-0000-0000-0000-000000000000}" host=$Computer$ user=$User$ | eval hour_of_the_day=strftime(_time,"%H") | where (hour_of_the_day &amp;gt;= 17 &amp;lt;![CDATA[or hour_of_the_day &amp;lt; 6]]&amp;gt;) | timechart count by user&lt;/SEARCHTEMPLATE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:42:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31591#M6547</guid>
      <dc:creator>jsb22</dc:creator>
      <dc:date>2020-09-28T11:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31592#M6548</link>
      <description>&lt;P&gt;This information has proved useful and I've been able to use it myself.  A question though, is it possible to alter this eval command to allow for searching in half hour periods?&lt;/P&gt;

&lt;P&gt;I'd like to do from 07:00-8:30 but using 8.5 will just round up to 9.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 09:50:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31592#M6548</guid>
      <dc:creator>srw46</dc:creator>
      <dc:date>2012-09-14T09:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31593#M6549</link>
      <description>&lt;P&gt;To access minutes in your search, you can add the following "|  eval min_of_the_day=strftime(_time,"%M")  " and search on "min_of_the_day" but there is an issue with my solution as if you're only searching for "min_of_the_day &amp;lt; 31", it will only look at the first half hour of EVERY hour, not just the last one. Unfortunately I'm not good at regex strings, so this is where I have to bow out.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:26:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31593#M6549</guid>
      <dc:creator>jsb22</dc:creator>
      <dc:date>2020-09-28T12:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Specific Hour Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31594#M6550</link>
      <description>&lt;P&gt;This is great.  I have been busting on this for quite some time.  I was able to get it to work by using the format below.  Thanks a bunch for the tip.&lt;/P&gt;

&lt;P&gt;This provides a search between 8am and 10pm for the day or days selected.&lt;BR /&gt;
ERRORCODE=001 | eval hour_of_the_day=strftime(_time,"%H") | where hour_of_the_day&amp;gt;07 | where hour_of_the_day&amp;lt;22&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specific-Hour-Search/m-p/31594#M6550</guid>
      <dc:creator>mark_groenveld</dc:creator>
      <dc:date>2020-09-29T10:20:22Z</dc:date>
    </item>
  </channel>
</rss>

