Using rsyslogd as pure syslog forwarder
From OISecWiki
# Load the UDP input module
module(load="imudp")
# Define a template to use server time (overwriting original timestamp)
template(name="ServerTimeTemplate" type="string"
string="<%PRI%>%timegenerated:::date-rfc3164% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n")
# Define a ruleset for UDP-received logs only
ruleset(name="udp_received") {
# Forward all messages in this ruleset over UDP using the template
action(type="omfwd"
target="10.235.66.15" # Replace with your remote host
port="5140"
protocol="udp"
template="ServerTimeTemplate")
# Stop further processing to prevent local logging
& stop
}
# Bind the UDP input to the ruleset
input(type="imudp"
port="514" # Adjust if needed
ruleset="udp_received")
