Skip to main content
  1. Posts/

Piping log files to a syslog server

·117 words·1 min·

If you have a centralized syslog server, or you use Splunk for log tracking, you may find the need to get older log files into a syslog port on that server.

Edit: Using logger (as suggested by David and Jerry below) will give you a more reliable way to send the data to a syslog server:

cat some.log | logger -t UsefulLabel -n -p 514

You’ll also be able to set a label for the text before it’s piped into the syslog server, which would be handy if you’re sorting or parsing the data later on.

Also, you can send your data in the raw using netcat:

cat some.log | nc -w 1 -u 514