One suggestion is to put this in a lookup file and then do some subsearch magic.
For instance if you have the following lookup file, let's call it maintenancetimes.csv :
MaintStart,MaintEnd
2018/04/25 21:00:00 AM,2018/04/25 22:00:00 AM
2018/04/27 22:00:00 AM,2018/04/28 02:00:00 AM
Then call this in a subsearch, and use return to create a search query that you can pass as raw input to the outer search:
index=my_data_index NOT [| inputlookup maintenancetimes.csv | convert timeformat="%Y/%m/%d %H:%M:%S %p" mktime(MaintEnd) mktime(MaintStart) | eval search="_time>".MaintStart." AND _time<".MaintEnd | return 500 $search]
After subsearch has been evaluated, the whole base search will look like
index=my_data_index NOT ((_time>1524682800 AND _time<1524686400) OR (_time>1524859200 AND _time<1524873600))
which hopefully is what you want 🙂
The only gotcha here is that return requires you to specify the max number of results to return. Just put something sensible and large in there. 🙂
... View more