I'm looking for a regular expression that I can use to scan for HTTP errors in my standard apache log files.
I'm interesting in matching all lines that don't have an HTTP 200 or HTTP 204 return status.
I can match the lines that do contain either HTTP 204 or HTTP 200 return code
grep 'HTTP[^"]*" 204 \| HTTP[^"]*" 200'
But I would like to have the inverse. I'm also sure the expression above can be optimized.
I need to feed such regular expression to an external program, so using grep -v
to inverse it is not an option.