How to remove my hostname from /var/log/syslog output?
by bariswheel from LinuxQuestions.org on (#6FV6G)
I want to improve readability of my syslog output by removing my hostname from every line logged. It's useless to me. Let's assume my hostname is john.corp.company.com
I run this command: sudo grc tail -f /var/log/syslog
To get logs on my terminal shell in realtime. What I tried:
sudo grc tail -f /var/log/syslog | sed 's/^john\.corp\.company\.com[[:blank:]]*//'
But then I lost the coloring that grc provides. I also tried similar commands with 'cut', 'awk', but those commands while they may do the job, I lose the coloring, and I really want to see the process in red, which is what GRC gives me.
At the end of the day, my goal is to get a realtime log of /var/log/syslog that is more readable, without the hostname, and even without the microseconds, as that makes the log line long as well, all I want to see really is the process name, and the message, and the time in seconds.
But question specifically here is how do I use grc still, remove the hostname from the output, and still have it redirect to stdout ?
I run this command: sudo grc tail -f /var/log/syslog
To get logs on my terminal shell in realtime. What I tried:
sudo grc tail -f /var/log/syslog | sed 's/^john\.corp\.company\.com[[:blank:]]*//'
But then I lost the coloring that grc provides. I also tried similar commands with 'cut', 'awk', but those commands while they may do the job, I lose the coloring, and I really want to see the process in red, which is what GRC gives me.
At the end of the day, my goal is to get a realtime log of /var/log/syslog that is more readable, without the hostname, and even without the microseconds, as that makes the log line long as well, all I want to see really is the process name, and the message, and the time in seconds.
But question specifically here is how do I use grc still, remove the hostname from the output, and still have it redirect to stdout ?