How to read bz2 zip file
# bzcat yourfile.log.bz2 | grep -i <string> | more
# bzcat /var/log/messages.2021.02.20.bz2
# bzgrep Archive $(hostname -s)-audit.log.2021.05.2*.bz2
# bxgrep -c fuser myhost-audit.log.2021.05.2*.bz2
# bzip2 -d myhost-audit.log.2021.05.2*.bz2
To uncompress
# bunzip2 myhost-audit.log.2021.05.2*.bz2
$ (hostname -s)-secure.20210520.bz2 | grep -E "Starting session.*file_upload" | cut -d' ' -f2 | sort | uniq -c
No comments:
Post a Comment