Gentoo Archives: gentoo-user

From: Peter Humphrey <peter@××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: [gentoo-user] How to trim logs?
Date: Sun, 07 May 2017 06:35:49
Message-Id: 2648047.v4XPS6BOFP@peak
1 Hello list,
2
3 I use a KVM switch to connect my mouse and keyboard to any of three boxes on
4 the LAN. Every time I switch to, say, the LAN server, I get spammed with a
5 bunch of messages like this (trimming out the first few fields):
6
7 kernel: usb 1-1: new high-speed USB device number 14 using ehci-pci
8 kernel: usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
9 kernel: usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
10 kernel: usb 1-1: Product: USB2.0 Hub
11 kernel: hub 1-1:1.0: USB hub found
12 kernel: hub 1-1:1.0: 4 ports detected
13 kernel: usb 1-1.1: new low-speed USB device number 15 using ehci-pci
14 kernel: usb 1-1.1: New USB device found, idVendor=046a, idProduct=0011
15 kernel: usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
16 kernel: input: HID 046a:0011 as /devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1.1/1-1.1:1.0/0003:046A:0011.0009/input/input14
17 kernel: hid-generic 0003:046A:0011.0009: input,hidraw0: USB HID v1.10 Keyboard [HID 046a:0011] on usb-0000:00:1d.7-1.1/input0
18 kernel: usb 1-1.2: new low-speed USB device number 16 using ehci-pci
19 kernel: usb 1-1.2: New USB device found, idVendor=046d, idProduct=c050
20 kernel: usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
21 kernel: usb 1-1.2: Product: USB-PS/2 Optical Mouse
22 kernel: usb 1-1.2: Manufacturer: Logitech
23 kernel: input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1.2/1-1.2:1.0/0003:046D:C050.000A/input/input15
24 kernel: hid-generic 0003:046D:C050.000A: input,hidraw1: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:1d.7-1.2/input0
25
26 Also, every time I connect an external disk I get this lot:
27
28 kernel: usb 1-4: new high-speed USB device number 17 using ehci-pci
29 kernel: usb 1-4: New USB device found, idVendor=0bc2, idProduct=331a
30 kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
31 kernel: usb 1-4: Product: Expansion Desk
32 kernel: usb 1-4: Manufacturer: Seagate
33 kernel: usb 1-4: SerialNumber: NA8EAGTY
34 kernel: usb-storage 1-4:1.0: USB Mass Storage device detected
35 kernel: scsi host6: usb-storage 1-4:1.0
36 kernel: usbcore: registered new interface driver usb-storage
37 kernel: scsi 6:0:0:0: Direct-Access Seagate Expansion Desk 0909 PQ: 0 ANSI: 6
38 kernel: sd 6:0:0:0: [sdb] 3907029167 512-byte logical blocks: (2.00 TB/1.82 TiB)
39 kernel: sd 6:0:0:0: [sdb] Write Protect is off
40 kernel: sd 6:0:0:0: [sdb] Mode Sense: 47 00 00 08
41 kernel: sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
42 kernel: sdb: sdb1 sdb2 < sdb5 >
43 kernel: sd 6:0:0:0: [sdb] Attached SCSI disk
44 kernel: EXT4-fs (sdb5): mounted filesystem with ordered data mode. Opts: (null)
45
46 In each case I'd like to omit the inessential lines from the VT-12 display;
47 I really don't need all that detail of the USB setup and it gets in the way
48 of what I do want to see, which is just the lines telling me which /dev/sdX
49 has been allocated to the disk, and probably nothing at all about the
50 mouse and keyboard.
51
52 I'm using syslog-ng. I've already modified syslog-ng.conf thus, to log cron
53 separately for the same reason:
54
55 [...]
56 source src { system(); internal(); };
57 filter f_cron { facility (cron); };
58 filter f_ncron { not facility (cron); };
59 destination d_cron { file("/var/log/cron"); };
60 destination messages { file("/var/log/messages"); };
61 destination console_all { file("/dev/tty12"); };
62 log { source(src); destination(messages); };
63 log { source(src); filter(f_cron); destination(d_cron); };
64 log { source(src); filter(f_ncron); destination(console_all); };
65
66 Is there a USB "facility" I can treat similarly? I haven't been able to find
67 where the facilities are defined.
68
69 --
70 Regards
71 Peter

Replies

Subject Author
Re: [gentoo-user] How to trim logs? Adam Carter <adamcarter3@×××××.com>