Post History
I have a GNU/Linux host that I use to aggregate syslog events from a few switches, printers, and generally less versatile hosts on my LAN. I set up rsyslog years ago to listen on UDP:514 and save ...
#3: Post edited
How do I prevent remote syslog events from printing locally?
- I have a GNU/Linux host that I use to aggregate syslog events from a few switches, printers, and generally less versatile hosts on my LAN.
- I set up rsyslog years ago to listen on UDP:514 and save syslog messages it receives from any host to `/var/log/netsyslog/${HostNameOrIPHere}.log` and that works.
- ("netsyslog" was my creation)
- LogRogate then regularly compresses them and rotates them out. It's delightful.
- But sometimes (depending on the "severity level" probably), the remote devices' messages also interrupt me when I'm SSH'd into my linux host. (In the middle of vim is particularly annoying.)
- How can I prevent any remote message (regardless of severity) from displaying on local login sessions?
- Here's my current config:
- ```
- ==> /etc/rsyslog.conf <==
- $ModLoad imudp
- $UDPServerRun 514
- $ModLoad imtcp
- $InputTCPServerRun 514
- $template DynaFile,"/var/log/netsyslog/%HOSTNAME%.log"
- *.* -?DynaFile
- $WorkDirectory /var/lib/rsyslog
- $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
- $IncludeConfig /etc/rsyslog.d/*.conf
- $OmitLocalLogging on
- $IMJournalStateFile imjournal.state
- *.info;mail.none;authpriv.none;cron.none /var/log/messages
- authpriv.* /var/log/secure
- mail.* -/var/log/maillog
- cron.* /var/log/cron
- *.emerg :omusrmsg:*
- uucp,news.crit /var/log/spooler
- local7.* /var/log/boot.log
- ```
- ```
- ==> /etc/rsyslog.d/listen.conf <==
- $SystemLogSocketName /run/systemd/journal/syslog
- ```
- I'm thinking I want to change: `*.emerg :omusrmsg:*`
- By adding sort of filter to it like `localhost.emerg`. But I'm not sure how to compose such a filter.
Maybe there's a more elegant way of doing this. I half thing perhaps I was wrong to use the same daemon to log locally-originated events as remote ones. I'm open to change.
- I have a GNU/Linux host that I use to aggregate syslog events from a few switches, printers, and generally less versatile hosts on my LAN.
- I set up rsyslog years ago to listen on UDP:514 and save syslog messages it receives from any host to `/var/log/netsyslog/${HostNameOrIPHere}.log` and that works.
- ("netsyslog" was my creation)
- LogRogate then regularly compresses them and rotates them out. It's delightful.
- But sometimes (depending on the "severity level" probably), the remote devices' messages also interrupt me when I'm SSH'd into my linux host. (In the middle of vim is particularly annoying.)
- How can I prevent any remote message (regardless of severity) from displaying on local login sessions?
- Here's my current config:
- ```
- ==> /etc/rsyslog.conf <==
- $ModLoad imudp
- $UDPServerRun 514
- $ModLoad imtcp
- $InputTCPServerRun 514
- $template DynaFile,"/var/log/netsyslog/%HOSTNAME%.log"
- *.* -?DynaFile
- $WorkDirectory /var/lib/rsyslog
- $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
- $IncludeConfig /etc/rsyslog.d/*.conf
- $OmitLocalLogging on
- $IMJournalStateFile imjournal.state
- *.info;mail.none;authpriv.none;cron.none /var/log/messages
- authpriv.* /var/log/secure
- mail.* -/var/log/maillog
- cron.* /var/log/cron
- *.emerg :omusrmsg:*
- uucp,news.crit /var/log/spooler
- local7.* /var/log/boot.log
- ```
- ```
- ==> /etc/rsyslog.d/listen.conf <==
- $SystemLogSocketName /run/systemd/journal/syslog
- ```
- I'm thinking I want to change: `*.emerg :omusrmsg:*`
- By adding sort of filter to it like `localhost.emerg`. But I'm not sure how to compose such a filter.
- Maybe there's a more elegant way of doing this. I half think perhaps I was wrong to use the same daemon to log locally-originated events as remote ones. I'm open to change.
#2: Post edited
- I have a GNU/Linux host that I use to aggregate syslog events from a few switches, printers, and generally less versatile hosts on my LAN.
I set up rsyslog years ago to listen on UDP:514 and save syslog messages it receives from any host to /var/log/netsyslog/${HostNameOrIPHere}.log and that works.- ("netsyslog" was my creation)
- LogRogate then regularly compresses them and rotates them out. It's delightful.
- But sometimes (depending on the "severity level" probably), the remote devices' messages also interrupt me when I'm SSH'd into my linux host. (In the middle of vim is particularly annoying.)
- How can I prevent any remote message (regardless of severity) from displaying on local login sessions?
- Here's my current config:
`[user@host ~]# grep -v -e '^$' -e '#.*$' /etc/rsyslog.* -r/etc/rsyslog.conf:$ModLoad imudp/etc/rsyslog.conf:$UDPServerRun 514/etc/rsyslog.conf:$ModLoad imtcp/etc/rsyslog.conf:$InputTCPServerRun 514/etc/rsyslog.conf:$template DynaFile,"/var/log/netsyslog/%HOSTNAME%.log"/etc/rsyslog.conf:*.* -?DynaFile/etc/rsyslog.conf:$WorkDirectory /var/lib/rsyslog/etc/rsyslog.conf:$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat/etc/rsyslog.conf:$IncludeConfig /etc/rsyslog.d/*.conf/etc/rsyslog.conf:$OmitLocalLogging on/etc/rsyslog.conf:$IMJournalStateFile imjournal.state/etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none /var/log/messages/etc/rsyslog.conf:authpriv.* /var/log/secure/etc/rsyslog.conf:mail.* -/var/log/maillog/etc/rsyslog.conf:cron.* /var/log/cron/etc/rsyslog.conf:*.emerg :omusrmsg:*/etc/rsyslog.conf:uucp,news.crit /var/log/spooler/etc/rsyslog.conf:local7.* /var/log/boot.log/etc/rsyslog.d/listen.conf:$SystemLogSocketName /run/systemd/journal/syslog`I'm thinking I want to change: *.emerg :omusrmsg:*By adding sort of filter to it like localhost.emerg. But I'm not sure how to compose such a filter.- Maybe there's a more elegant way of doing this. I half thing perhaps I was wrong to use the same daemon to log locally-originated events as remote ones. I'm open to change.
- I have a GNU/Linux host that I use to aggregate syslog events from a few switches, printers, and generally less versatile hosts on my LAN.
- I set up rsyslog years ago to listen on UDP:514 and save syslog messages it receives from any host to `/var/log/netsyslog/${HostNameOrIPHere}.log` and that works.
- ("netsyslog" was my creation)
- LogRogate then regularly compresses them and rotates them out. It's delightful.
- But sometimes (depending on the "severity level" probably), the remote devices' messages also interrupt me when I'm SSH'd into my linux host. (In the middle of vim is particularly annoying.)
- How can I prevent any remote message (regardless of severity) from displaying on local login sessions?
- Here's my current config:
- ```
- ==> /etc/rsyslog.conf <==
- $ModLoad imudp
- $UDPServerRun 514
- $ModLoad imtcp
- $InputTCPServerRun 514
- $template DynaFile,"/var/log/netsyslog/%HOSTNAME%.log"
- *.* -?DynaFile
- $WorkDirectory /var/lib/rsyslog
- $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
- $IncludeConfig /etc/rsyslog.d/*.conf
- $OmitLocalLogging on
- $IMJournalStateFile imjournal.state
- *.info;mail.none;authpriv.none;cron.none /var/log/messages
- authpriv.* /var/log/secure
- mail.* -/var/log/maillog
- cron.* /var/log/cron
- *.emerg :omusrmsg:*
- uucp,news.crit /var/log/spooler
- local7.* /var/log/boot.log
- ```
- ```
- ==> /etc/rsyslog.d/listen.conf <==
- $SystemLogSocketName /run/systemd/journal/syslog
- ```
- I'm thinking I want to change: `*.emerg :omusrmsg:*`
- By adding sort of filter to it like `localhost.emerg`. But I'm not sure how to compose such a filter.
- Maybe there's a more elegant way of doing this. I half thing perhaps I was wrong to use the same daemon to log locally-originated events as remote ones. I'm open to change.
#1: Initial revision
How do I prevent remote syslog events from printing locally?
I have a GNU/Linux host that I use to aggregate syslog events from a few switches, printers, and generally less versatile hosts on my LAN. I set up rsyslog years ago to listen on UDP:514 and save syslog messages it receives from any host to /var/log/netsyslog/${HostNameOrIPHere}.log and that works. ("netsyslog" was my creation) LogRogate then regularly compresses them and rotates them out. It's delightful. But sometimes (depending on the "severity level" probably), the remote devices' messages also interrupt me when I'm SSH'd into my linux host. (In the middle of vim is particularly annoying.) How can I prevent any remote message (regardless of severity) from displaying on local login sessions? Here's my current config: `[user@host ~]# grep -v -e '^$' -e '#.*$' /etc/rsyslog.* -r /etc/rsyslog.conf:$ModLoad imudp /etc/rsyslog.conf:$UDPServerRun 514 /etc/rsyslog.conf:$ModLoad imtcp /etc/rsyslog.conf:$InputTCPServerRun 514 /etc/rsyslog.conf:$template DynaFile,"/var/log/netsyslog/%HOSTNAME%.log" /etc/rsyslog.conf:*.* -?DynaFile /etc/rsyslog.conf:$WorkDirectory /var/lib/rsyslog /etc/rsyslog.conf:$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat /etc/rsyslog.conf:$IncludeConfig /etc/rsyslog.d/*.conf /etc/rsyslog.conf:$OmitLocalLogging on /etc/rsyslog.conf:$IMJournalStateFile imjournal.state /etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none /var/log/messages /etc/rsyslog.conf:authpriv.* /var/log/secure /etc/rsyslog.conf:mail.* -/var/log/maillog /etc/rsyslog.conf:cron.* /var/log/cron /etc/rsyslog.conf:*.emerg :omusrmsg:* /etc/rsyslog.conf:uucp,news.crit /var/log/spooler /etc/rsyslog.conf:local7.* /var/log/boot.log /etc/rsyslog.d/listen.conf:$SystemLogSocketName /run/systemd/journal/syslog` I'm thinking I want to change: *.emerg :omusrmsg:* By adding sort of filter to it like localhost.emerg. But I'm not sure how to compose such a filter. Maybe there's a more elegant way of doing this. I half thing perhaps I was wrong to use the same daemon to log locally-originated events as remote ones. I'm open to change.