0

I'm looking to do a tag based forwarding instead of using local1. local1 is used for other things so I don't want it to get mixed up. How can I do this? Here's my config forwarding nginx logs under /etc/rsyslog.d/nginx.conf

module(load="imfile" mode="inotify" PollingInterval="10")
input(type="imfile"
      File="/var/log/nginx.log"
      Severity="info"
      Tag="nginx.log"
      Facility="local1")
local1.* action(type="omfwd" target="0.0.0.0" port="2518" protocol="udp")
& stop
hmallett
  • 2,455
  • 14
  • 26

1 Answers1

0

You can test for the tag with a filter such as:

if $syslogtag=="nginx.log" then action(...)
& stop
meuh
  • 1,563
  • 10
  • 11