메뉴 닫기

CCZE – Colorize log files

CCZE tool은 로그파일에 색상을 지정해서 좀더 보기 쉽게 해주는 툴입니다.
본인에 시스템관리 스타일에 따라 색상을 손쉽게 바꿀수 있는 장점이 있어 유용하게 사용할수 있습니다.

본문은 CentOS 6.X x86_64 환경에서 예문으로 작성되었습니다.
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
# yum install -y ccze

# tail -f /var/log/message
ccze1

# tail -f /var/log/message | ccze -A
ccze2

# tail -f /etc/httpd/logs/website-access_log
ccze3

# tail -f /etc/httpd/logs/website-access_log | ccze -A
ccze4

html 파일로 포캣변환
# cat /var/log/message > ccze -h > /home/xxxx/xxxx/syslog_ccze.html
ccze5

 

설정파일
/etc/cczerc, $HOME/.cczerc

아래와 같이 다양한 플러그인이 있으니 재미지게 사용하시길……
# ccze -l

Available plugins:

Name | Type | Description
————————————————————
apm | Partial | Coloriser for APM sub-logs.
distcc | Full | Coloriser for distcc(1) logs.
exim | Full | Coloriser for exim logs.
fetchmail | Partial | Coloriser for fetchmail(1) sub-logs.
ftpstats | Full | Coloriser for ftpstats (pure-ftpd) logs.
httpd | Full | Coloriser for generic HTTPD access and error logs.
icecast | Full | Coloriser for Icecast(8) logs.
oops | Full | Coloriser for oops proxy logs.
php | Full | Coloriser for PHP logs.
postfix | Partial | Coloriser for postfix(1) sub-logs.
procmail | Full | Coloriser for procmail(1) logs.
proftpd | Full | Coloriser for proftpd access and auth logs.
squid | Full | Coloriser for squid access, store and cache logs.
sulog | Full | Coloriser for su(1) logs.
super | Full | Coloriser for super(1) logs.
syslog | Full | Generic syslog(8) log coloriser.
ulogd | Partial | Coloriser for ulogd sub-logs.
vsftpd | Full | Coloriser for vsftpd(8) logs.
xferlog | Full | Generic xferlog coloriser.

 

# ccze –help
Usage: ccze [OPTION…]
ccze — cheer up ‘yer logs.

-a, –argument=PLUGIN=ARGS… Add ARGUMENTS to PLUGIN
-A, –raw-ansi Generate raw ANSI output
-c, –color=KEY=COLOR,… Set the color of KEY to COLOR
-C, –convert-date Convert UNIX timestamps to readable format
-F, –rcfile=FILE Read configuration from FILE
-h, –html Generate HTML output
-l, –list-plugins List available plugins
-m, –mode=MODE Change the output mode (Available modes are curses, ansi and html.)
-o, –options=OPTIONS… Toggle some options (such as scroll, wordcolor and lookups, transparent, or cssfile)
-p, –plugin=PLUGIN Load PLUGIN
-r, –remove-facility remove syslog-ng’s facility from start of the lines
-?, –help Give this help list
–usage Give a short usage message
-V, –version Print program version

Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options.

Report bugs to <algernon@bonehunter.rulez.org>.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x