<?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: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350726#M162275</link>
    <description>&lt;P&gt;Yes sure why not? &lt;/P&gt;

&lt;P&gt;Please upvote the comments that were useful after you accepted the answer&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2018 10:16:36 GMT</pubDate>
    <dc:creator>tiagofbmm</dc:creator>
    <dc:date>2018-03-19T10:16:36Z</dc:date>
    <item>
      <title>I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350706#M162255</link>
      <description>&lt;P&gt;I used this query:&lt;/P&gt;

&lt;P&gt;index="abc" source="xyz"&lt;BR /&gt;
| search [inputlookup example]&lt;BR /&gt;
| eval End=strptime("End_Date_Time","%Y/%m/%d %H:%M:%S") | eval Start=strptime("Start_Date_Time","%Y/%m/%d %H:%M:%S") | where  (_time &amp;gt; End) OR (_time &amp;lt; Start)&lt;/P&gt;

&lt;P&gt;This isn't returning any events. Any help?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350706#M162255</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2020-09-29T18:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350707#M162256</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Make sure the End_Date_Time and Start_Date_Time are both strings and the format of the strptime is correct agains this documentation:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Commontimeformatvariables" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="abc" source="xyz"  [ | inputlookup example | eval latest=strptime(End_Date_Time,"%Y-%m-%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y-%m-%d %H:%M:%S") | return earliest, latest]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350707#M162256</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2020-09-29T18:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350708#M162257</link>
      <description>&lt;P&gt;That didn't help. Same thing. No events.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:04:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350708#M162257</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2018-03-15T11:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350709#M162258</link>
      <description>&lt;P&gt;Can you show me a line in your example lookup please?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350709#M162258</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-15T11:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350710#M162259</link>
      <description>&lt;P&gt;Description    End_Date_Time            Requested_By    Start_Date_Time                                      Maintenance       2018/03/10 12:00:00  Sam         2018/03/10 01:00:00&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350710#M162259</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2020-09-29T18:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350711#M162260</link>
      <description>&lt;P&gt;Btw I had a typo in my answer, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="abc" source="xyz"  
[ | inputlookup example
 | eval latest=strptime(End_Date_Time,"%Y-%m-%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y-%m-%d %H:%M:%S") 
| return earliest, latest]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:16:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350711#M162260</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-15T11:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350712#M162261</link>
      <description>&lt;P&gt;Ok so that was the problem the format of strptime:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index="abc" source="xyz"  
 [ | inputlookup example
  | eval latest=strptime(End_Date_Time,"%Y/%m/%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y/%m/%d %H:%M:%S") 
 | return earliest, latest]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try it and let me know&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350712#M162261</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-15T11:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350713#M162262</link>
      <description>&lt;P&gt;Ah yes. That works. But, what I want is the opposite. &lt;STRONG&gt;I want to exclude the events of the time specified&lt;/STRONG&gt; and want the rest of them. &lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:30:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350713#M162262</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2018-03-15T11:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350714#M162263</link>
      <description>&lt;P&gt;There you go&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index="abc" source="xyz"  
  [ | inputlookup example
   | eval latest=strptime(End_Date_Time,"%Y/%m/%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y/%m/%d %H:%M:%S") 
  | eval maintenance="_time&amp;lt;"+earliest+" OR _time&amp;gt;"+latest 
| return $maintenance]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:45:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350714#M162263</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-15T11:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350715#M162264</link>
      <description>&lt;P&gt;Hi Can you try :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="abc" source="xyz"  
 [ | inputlookup example
  | eval latest1=strptime(End_Date_Time,"%Y-%m-%d %H:%M:%S") , earliest1=strptime(Start_Date_Time,"%Y-%m-%d %H:%M:%S")] | search _time &amp;gt; latest1 OR _time &amp;lt; earliest1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350715#M162264</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-15T11:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350716#M162265</link>
      <description>&lt;P&gt;Thanks a lot! That worked like a charm. Much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350716#M162265</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2018-03-15T11:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350717#M162266</link>
      <description>&lt;P&gt;Any idea how would this work if my lookup has multiple entries?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350717#M162266</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2018-03-15T11:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350718#M162267</link>
      <description>&lt;P&gt;Yes, just use logic on it, negating many periods of maintenance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="abc" source="xyz"  
   [ | inputlookup example
    | eval latest=strptime(End_Date_Time,"%Y/%m/%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y/%m/%d %H:%M:%S") 
| eval maintenance="NOT (_time&amp;gt;"+earliest+" AND _time&amp;lt;"+latest+")" 
| return 10 $maintenance 
| rex mode=sed field=search "s/OR/AND/g" 
| return $search]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note the 10 after return is just the number of lines of mantenance periods you may have. Feel free to increase that number to whatever you need.&lt;/P&gt;

&lt;P&gt;Let me know if it works&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 12:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350718#M162267</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-15T12:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350719#M162268</link>
      <description>&lt;P&gt;Yes! That works! Awesome. Could you please explain [rex mode=sed field=search "s/OR/AND/g"]? Want to learn.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 12:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350719#M162268</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2018-03-15T12:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350720#M162269</link>
      <description>&lt;P&gt;Yes, the return give you an ORed list of the values you are returning.&lt;/P&gt;

&lt;P&gt;But now you need to make a UNION of the maintenance intervals, and that needs to be a logical AND. That is the only thing the rex is doing.&lt;/P&gt;

&lt;P&gt;Please UPVOTE the comment if it is useful for you!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 12:43:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350720#M162269</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-15T12:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350721#M162270</link>
      <description>&lt;P&gt;Off - topic. What if you have two that index and source in a lookup, how would that work?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 09:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350721#M162270</guid>
      <dc:creator>timmag</dc:creator>
      <dc:date>2018-03-16T09:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350722#M162271</link>
      <description>&lt;P&gt;Yes, if you want just to filter for specific indexes and sources, just add them to the &lt;STRONG&gt;return&lt;/STRONG&gt; command part.&lt;/P&gt;

&lt;P&gt;To make sure you are getting what you want, practice with the part of the inputlookup and see the results of something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup example
     | eval latest=strptime(End_Date_Time,"%Y/%m/%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y/%m/%d %H:%M:%S") 
 | eval maintenance="NOT (_time&amp;gt;"+earliest+" AND _time&amp;lt;"+latest+")" 
 | return 10 $maintenance, index
 | rex mode=sed field=search "s/OR/AND/g" 
 | return $search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Mar 2018 09:42:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350722#M162271</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-16T09:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350723#M162272</link>
      <description>&lt;P&gt;The index and source would be part of a different lookup.&lt;BR /&gt;
Lookup1:&lt;BR /&gt;
Index                 Source&lt;BR /&gt;
abc                     xyz&lt;BR /&gt;
def                      fgh&lt;/P&gt;

&lt;P&gt;Now,&lt;BR /&gt;
Can I do this?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;|inputlookup lookup1 |&lt;/STRONG&gt; search[| inputlookup planned_downtime_ee&lt;BR /&gt;
     | eval latest=strptime(End_Date_Time,"%Y/%m/%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y/%m/%d %H:%M:%S") &lt;BR /&gt;
 | eval maintenance="NOT (_time&amp;gt;"+earliest+" AND _time&amp;lt;"+latest+")" &lt;BR /&gt;
 | return 10 $maintenance &lt;BR /&gt;
 | rex mode=sed field=search "s/OR/AND/g" &lt;BR /&gt;
 | return $search&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350723#M162272</guid>
      <dc:creator>timmag</dc:creator>
      <dc:date>2020-09-29T18:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350724#M162273</link>
      <description>&lt;P&gt;You can do that but you are forgetting the return in the &lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search [ |inputlookup lookup1 | return 10 index,source] [| inputlookup planned_downtime_ee
| eval latest=strptime(End_Date_Time,"%Y/%m/%d %H:%M:%S") , earliest=strptime(Start_Date_Time,"%Y/%m/%d %H:%M:%S") 
| eval maintenance="NOT (_time&amp;gt;"+earliest+" AND _time&amp;lt;"+latest+")" 
| return 10 $maintenance 
| rex mode=sed field=search "s/OR/AND/g" 
| return $search]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So for any pair of index, source in the lookup1, you are excluding all the maintenance times. This logically only works if the maintenance times are the same for all pairs (index,source).&lt;/P&gt;

&lt;P&gt;If not, then you need to have a correspondence between maintenance perior and (index,source) pairs&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 10:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350724#M162273</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-16T10:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not able to exclude maintenance time from my events when I use inputlookup. Any tips?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350725#M162274</link>
      <description>&lt;P&gt;Instead of all this, can I use a savedsearch?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 10:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-not-able-to-exclude-maintenance-time-from-my-events-when-I/m-p/350725#M162274</guid>
      <dc:creator>timmag</dc:creator>
      <dc:date>2018-03-19T10:14:09Z</dc:date>
    </item>
  </channel>
</rss>

