ANSI color escape sequences appear as strings, not colors in logs written by rsyslog?
Issue
- Refer the /var/log/messages file, where we can see control characters.
- Refer the /var/log/boot.log
May 27 14:20:22 localhost (BreakGlass):INC12345:root: ## Access to system based on :INC12345:root:
May 27 14:20:22 localhost (BreakGlass):INC12345:root: Wed May 27 14:18:17 EDT 2015
May 27 14:20:22 localhost (BreakGlass):INC12345:root: Script started on Wed May 27 14:18:20 2015
May 27 14:20:22 localhost (BreakGlass):INC12345:root: #033]0;root@localhost:~#007#033[?1034hCS-SHELL# #015
May 27 14:20:22 localhost (BreakGlass):INC12345:root: #033]0;root@localhost:~#007CS-SHELL# ls#015
May 27 14:20:22 localhost (BreakGlass):INC12345:root: #033[0m#033[01;34mCreateYourOwnSharedObjects--2#033[0m core.5651 #033[01;31mglibc-2.12-1.107.el6.x86_64.rpm#033[0m install.log.syslog #033[01;32mproc_stat#033[0m #033[01;32mtest#033[0m#015
[root@vm183 ~]# tail -5 /var/log/boot.log
Jan 13 16:34:00 bootlog: Starting sm-client: #033[60G[#033[0;32m OK #033[0;39m]#015#015
Jan 13 16:34:00 bootlog: Starting abrt daemon: #033[60G[#033[0;32m OK #033[0;39m]#015#015
Jan 13 16:34:00 bootlog: Starting atd: #033[60G[#033[0;32m OK #033[0;39m]#015#015
Jan 13 16:34:00 bootlog: Starting rhsmcertd...#033[60G[#033[0;32m OK #033[0;39m]#015#015
Jan 13 16:34:00 bootlog: Starting certmonger: #033[60G[#033[0;32m OK #033[0;39m]#015#015
[root@vm183 ~]#
Environment
- Red Hat Enterprise Linux ALL
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.