This appears to be your real problem...
Quote:
Originally Posted by pedropt
... i am parsing the log files for anomalies ...
|
Quote:
Originally Posted by pedropt
I was thinking in setting just 1 log variable as :
log="/var/log/nginx/access.log*"
but this will include also the gzip files inside nginx logs directory , witch are access.log.2.gz , etc... , and i do not want that .
|
The answer is to use --exclude, as described in "
grep --help" (and
man grep):
Code:
grep something /var/log/nginx/access.log* --exclude='*.gz'
Or simply use
zgrep to decompress those files before searching them.
(p.s., use "
[code]..[/code]" not "
[quote]..[/quote]" when posting code.)