2

I have a few linux systems with the keyboard and console shared via a KVM switch. When I switch between them, I get a lot of unwanted syslog messages regarding the keyboard connecting and disconnecting. This is a particular issue for me because I like to keep the console of each system permanently monitoring "live" syslog messages with tail -f /var/log/syslog.

Here's one, for example:

Nov  7 01:03:37 PIHOSTNAME kernel: [1648435.194330] usb 1-1.3.2: new low-speed USB device number 55 using dwc_otg

I'm able to remove all the keyboard messages with a bunch of rules in /etc/rsyslog.conf. For the above example I use:

:msg, contains, "new low-speed USB device " STOP

That works fine, but I'd like to keep ONE message to confirm when the keyboard is connected - and modify it a bit for user-friendliness. For example:

:msg, contains, "new low-speed USB device " :msg+" - Keyboard Successfully Connected!"

(The above rule doesn't work, of course)

I had hoped it would output something like this:

Nov  7 01:03:37 PIHOSTNAME kernel: [1648435.194330] usb 1-1.3.2: new low-speed USB device number 55 using dwc_otg - Keyboard Successfully Connected!
  1. How can I modify my rule to add the extra text?
  2. Also, how can I modify my rule to replace certain characters with the new text?

Thanks.

EEAA
  • 108,414
  • 18
  • 172
  • 242
Cor
  • 51
  • 3

0 Answers0