How to do port based filtering in rsyslog?

Solution Verified - Updated -


  • rsyslog instance that is running on multiple ports listening for both TCP and UDP. Our requirement is that the servers connecting to port 514 should have their logs stored in something like /logbase/port-514/%hostname.
  • want to set a separate log file for logging messages received on different ports.


Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In