X-Git-Url: https://git.datadissipation.net/logtools/blobdiff_plain/4661018d1dc628ce4fcf2a06d9fa66f6af6c8c24..HEAD:/esearchlog diff --git a/esearchlog b/esearchlog index 228c0da..a9cc280 100755 --- a/esearchlog +++ b/esearchlog @@ -12,4 +12,4 @@ err() { # there's no way for only one printf to fail [ -z "$SERVER" ] && SERVER=$(which > /dev/null 2>&1 apache2 && printf "apache2" || which > /dev/null 2>&1 nginx && printf "nginx" || err) -{ cat /var/log/"$SERVER"/error.log /var/log/"$SERVER"/error.log.1; gzip -cd $(ls /var/log/"$SERVER"/error.log.*.gz | sort -V); } | grep --color=auto -a "$@" +{ gzip -cd $(ls /var/log/"$SERVER"/error.log.*.gz | sed 's/.*\.\([0-9]*\)\.gz/\1 &/' | sort -rn | cut -d' ' -f2-); cat /var/log/"$SERVER"/error.log.1 /var/log/"$SERVER"/error.log; } | grep --color=auto -a "$@"