<?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: How do you exclude certain days from a time range? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-certain-days-from-a-time-range/m-p/11470#M784</link>
    <description>&lt;P&gt;To exclude wednesday you would add 'date_wday!=wednesday' to your search.&lt;/P&gt;

&lt;P&gt;Check this article out for more information about the internal date fields - &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1/User/UseDefaultAndInternalFields" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1/User/UseDefaultAndInternalFields&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Apr 2010 19:41:45 GMT</pubDate>
    <dc:creator>netwrkr</dc:creator>
    <dc:date>2010-04-14T19:41:45Z</dc:date>
    <item>
      <title>How do you exclude certain days from a time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-certain-days-from-a-time-range/m-p/11469#M783</link>
      <description>&lt;P&gt;If you have a time range and certain days contain data you'd like to exclude can you drop the days from your search result?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2010 19:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-certain-days-from-a-time-range/m-p/11469#M783</guid>
      <dc:creator>Marinus</dc:creator>
      <dc:date>2010-04-14T19:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do you exclude certain days from a time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-certain-days-from-a-time-range/m-p/11470#M784</link>
      <description>&lt;P&gt;To exclude wednesday you would add 'date_wday!=wednesday' to your search.&lt;/P&gt;

&lt;P&gt;Check this article out for more information about the internal date fields - &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1/User/UseDefaultAndInternalFields" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1/User/UseDefaultAndInternalFields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2010 19:41:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-certain-days-from-a-time-range/m-p/11470#M784</guid>
      <dc:creator>netwrkr</dc:creator>
      <dc:date>2010-04-14T19:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you exclude certain days from a time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-certain-days-from-a-time-range/m-p/11471#M785</link>
      <description>&lt;P&gt;You could filter out events based on the &lt;CODE&gt;_time&lt;/CODE&gt; field using a &lt;CODE&gt;where&lt;/CODE&gt; search command.  This is more difficult to setup that using &lt;CODE&gt;date_wday&lt;/CODE&gt;, but it's very flexible.&lt;/P&gt;

&lt;P&gt;The basic approach would be to preform your search, then grab the timerange of your searchs using the &lt;CODE&gt;addinfo&lt;/CODE&gt; search command.  Then use the &lt;CODE&gt;where&lt;/CODE&gt; search to filter out the unwanted events in the middle of your search range.&lt;/P&gt;

&lt;P&gt;For example, say you were searching over a 1 hour window, but want to remove the center 30 minutes (so remove events between 15 after to 45 minutes after), you could do a search like this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;BLOCKQUOTE&gt;
    &lt;P&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; earliest=-1h@h latest=@h | addinfo | where _time &amp;lt; (info_min_time+900) OR _time &amp;gt; (info_max_time-900)&lt;/CODE&gt;&lt;/P&gt;
  &lt;/BLOCKQUOTE&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&lt;EM&gt;Some additional thoughts:&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Along with &lt;CODE&gt;info_min_time&lt;/CODE&gt;, &lt;CODE&gt;info_max_time&lt;/CODE&gt; which I used in this example, there is also &lt;CODE&gt;info_search_time&lt;/CODE&gt; which could be used if you wanted to do some time operations relative to the system time when you run your search.&lt;/P&gt;

&lt;P&gt;Note that you can also use &lt;CODE&gt;_indextime&lt;/CODE&gt; here, if you wanted to look at when your events were actually indexed rather than when your events occurred; which is sometimes interesting to look at.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2010 21:14:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-certain-days-from-a-time-range/m-p/11471#M785</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-04-14T21:14:07Z</dc:date>
    </item>
  </channel>
</rss>

