Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Apr 2017 17:41:46 -0400
From:      Ernie Luzar <luzar722@gmail.com>
To:        FreeBSD questions <freebsd-questions@FreeBSD.org>
Subject:   pipe syslog records to a script 
Message-ID:  <58E2C19A.40306@gmail.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?58E2C19A.40306>