How to do port based filtering in rsyslog?

Solution Verified - Updated -

Issue

  • 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.

Environment

Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
rsyslog

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