Score:0

Prevent ufw to log lines based on string/keyword?

ye flag

Is it possible to prevent certain repeating lines to be logged in ufw log?

I basically wants to stop all lines containing UFW BLOCK & SRC=192.168.0.202

Full line example:

Feb  5 13:03:38 ddomain kernel: [173885.985537] [UFW BLOCK] IN= OUT=enp0s3 SRC=192.168.0.202 DST=192.168.0.1 LEN=328 TOS=0x00 PREC=0x00 TTL=64 ID=5497 DF PROTO=UDP SPT=68 DPT=67 LEN=308

I've figured out that it has something to do with rsyslog and the configuration file 20-ufw.conf

# Log kernel generated UFW log messages to file
:msg,contains,"[UFW " /var/log/ufw.log

# Uncomment the following to stop logging anything that matches the last rule.
# Doing this will stop logging kernel generated UFW log messages to the file
# normally containing kern.* messages (eg, /var/log/kern.log)
& stop

and maybe add something like :msg,not contains,"SRC=192.168.0.202" ??

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.