To add to @gayavat’s answer (which has put me on the right track), here is a real-life example:
NOT message:(view.html)
This is assuming I’ve got a filed “message”, which is standard for Java logs.
Or, you can combine it with other criteria:
pension AND NOT message:(view.html)
That will search for all occurrences of “pension”, excluding those appearing together with the “view.html”