pipe syslog records to a script

Ernie Luzar luzar722 at gmail.com
Mon Apr 3 21:41:21 UTC 2017


Hello list;

In syslog.conf I have these 2 lines.
local0.*       /var/log/security
local0.*      | exec /usr/local/bin/ipf.table

The security log file is being populated and working fine.
Now I want to pipe the same log records to a script for processing.

The ipf.table script looks like this

#! /bin/sh
$1 >> /var/log/ipf.table.log1
$@ >> /var/log/ipf.table.log2
$* >> /var/log/ipf.table.log3

  service syslogd restart

The ipf.table.log1, 2, 3 never get populated even though I see new 
entries in the security.log file.

What am I doing wrong here?

Thanks for your help.


More information about the freebsd-questions mailing list