I am new to rsyslog. I have multiple servers(rsyslog servers) sending syslog messages to a remote server(syslog-ng server). Right now, I am sending everything to the remote server. I want to filter out and send logs from specific files to the remote server.
10-custom.conf - this is the custom config file which I am using
#Forward specific logs to remote server
module(load="imfile")
input(type="imfile"
file="/var/log/tomcat8/bar.log"
Tag="bar:")
input(type="imfile"
file="/var/log/tomcat8/foo.log"
Tag="foo:")
input(type="imfile"
file="/var/log/dpkg.log"
Tag="dpkg:")
input(type="imfile"
file="/var/log/syslog"
Tag="syslog:")
input(type="imfile"
file="/var/log/auth.log"
Tag="auth:")
input(type="imfile"
file="/var/log/kern.log"
Tag="kern:")
#if $Tag == "catalina:" then @@remoteserver:port
:syslogtag, isequal, "catalina:" @@remoteserver:port
& stop
I am trying to filter out based on Tags and send it to remote server. I couldn't get this working.
What's best way to get this set up?
Thanks in advance!