You can do that but you are forgetting the return in the return
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>"+earliest+" AND _time<"+latest+")"
| return 10 $maintenance
| rex mode=sed field=search "s/OR/AND/g"
| return $search]
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).
If not, then you need to have a correspondence between maintenance perior and (index,source) pairs
... View more