I'm trying to produce a compliance report that searches through a particular block of config for a set of configuration lines. My example is this:
start
config line a
config line b
config line c
config line d
end
I want to check for config lines a,b and c within a particular interface configuration, and then have the report flag a problem. My issue is I don't know how to delimt the search. I'm not a regex man by many means but I think the following should work:
start.*\n(.*\n)*.*config line a.*\n(.*\n)*.*config line b.*\n(.*\n)*.config line c.*\n(.*\n)*.*end
However this may give me false positives in that this:
start
config line a
end
start
config line b
end
start
config line c
end
start
config line d
end
...should also give me an alert in my report; it's searching the entire config rather than just betwen the "start" and "end" delimiters. Has anyone come across this before and managed to overcome it?
Thanks
Darren