<?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 How to Exclude Events on a Certain Day, within a Certain Time, and With a Specific User in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565921#M197192</link>
    <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I need to exclude events that happen every Saturday between 2 AM and 4AM only if they have a specific username. An authenticated scan runs that triggers a lot of logon attempts with a specific user account during that time.&amp;nbsp; My search so far isn't working:&lt;BR /&gt;&lt;BR /&gt;index=[myindex] host=* sourcetype=linux_secure process=sshd ("tag::action"="success" OR "tag::action"="failure")&lt;BR /&gt;| eval hour = tonumber(strftime(_time,"%H"))&lt;BR /&gt;| eval dow = tonumber(strftime(_time,"%w"))&lt;BR /&gt;| where (dow!=6 AND (hour!=2 OR hour!=3 OR hour!=4) AND user=[username])&lt;BR /&gt;&lt;BR /&gt;However, as soon as I remove the username variable the search works fine.&amp;nbsp; Can anyone help me figure out what's wrong?&amp;nbsp; Thanks.&lt;/P&gt;</description>
    <pubDate>Sun, 05 Sep 2021 02:50:36 GMT</pubDate>
    <dc:creator>SplunkLunk</dc:creator>
    <dc:date>2021-09-05T02:50:36Z</dc:date>
    <item>
      <title>How to Exclude Events on a Certain Day, within a Certain Time, and With a Specific User</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565921#M197192</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I need to exclude events that happen every Saturday between 2 AM and 4AM only if they have a specific username. An authenticated scan runs that triggers a lot of logon attempts with a specific user account during that time.&amp;nbsp; My search so far isn't working:&lt;BR /&gt;&lt;BR /&gt;index=[myindex] host=* sourcetype=linux_secure process=sshd ("tag::action"="success" OR "tag::action"="failure")&lt;BR /&gt;| eval hour = tonumber(strftime(_time,"%H"))&lt;BR /&gt;| eval dow = tonumber(strftime(_time,"%w"))&lt;BR /&gt;| where (dow!=6 AND (hour!=2 OR hour!=3 OR hour!=4) AND user=[username])&lt;BR /&gt;&lt;BR /&gt;However, as soon as I remove the username variable the search works fine.&amp;nbsp; Can anyone help me figure out what's wrong?&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 02:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565921#M197192</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2021-09-05T02:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Exclude Events on a Certain Day, within a Certain Time, and With a Specific User</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565926#M197195</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/175735"&gt;@SplunkLunk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: you wnat to exclude from the results of your main search the logon of a predefined username (e.g. jde) in the hours between 2 and 4, is it correct?&lt;/P&gt;&lt;P&gt;if this is yuor need, probably there's an error in your search because the AND condition at the end excludes all the other logins.&lt;/P&gt;&lt;P&gt;In addition, you don't need to use eval and where, because you can put in yur main search the other conditions using the field "date_hour".&lt;/P&gt;&lt;P&gt;So, pleae, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=[myindex] sourcetype=linux_secure process=sshd ("tag::action"="success" OR "tag::action"="failure") NOT ((date_hour&amp;gt;1 date_hour&amp;lt;5) user=[username]))
| ...&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 09:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565926#M197195</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-05T09:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to Exclude Events on a Certain Day, within a Certain Time, and With a Specific User</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565932#M197201</link>
      <description>&lt;P&gt;Thanks, but how do I exclude Saturday as well as part of the condition?&amp;nbsp; The "date_wday=saturday" doesn't work and that's why I did the eval to assign a day of the week in the search.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 10:36:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565932#M197201</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2021-09-05T10:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Exclude Events on a Certain Day, within a Certain Time, and With a Specific User</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565934#M197202</link>
      <description>&lt;P&gt;Thanks. I figured it out with your help.&amp;nbsp; It turns out date_wday was being extracted as well. I just had the search term formed wrong.&amp;nbsp; I ended up with the following:&lt;/P&gt;&lt;P&gt;NOT ((date_hour&amp;gt;=1 date_hour&amp;lt;5) AND user=[username] AND date_wday=saturday)&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 12:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565934#M197202</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2021-09-05T12:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Exclude Events on a Certain Day, within a Certain Time, and With a Specific User</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565979#M197219</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/175735"&gt;@SplunkLunk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 07:18:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Exclude-Events-on-a-Certain-Day-within-a-Certain-Time-and/m-p/565979#M197219</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-06T07:18:56Z</dc:date>
    </item>
  </channel>
</rss>

