Subject: Re: Tool for processing "ipmon" output
To: Herb Peyerl <hpeyerl@beer.org>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: tech-net
Date: 03/01/1999 00:11:29
In some email I received from Herb Peyerl, sie wrote:
[...]
> DATE=`date '+\&date=%Y%m%d\&time=%H%M%S'`
> ipfstat -ai -ao | sed "
>         s/count [a-z][a-z]* on [a-z][a-z0-9]* from any //
>         s/ count [a-z][a-z]* on [a-z][a-z0-9]*//
>         s/ to any//
>         s/\/.*$//
>         s/^/GET \/log\/log.cgi\?count=/
>         s/ from /\&direction=1\&address=/
>         s/ to /\&direction=0\&address=/
>         s/$/$DATE/
> " | (ipf -z -f /etc/ipf.conf >/dev/null ; sort +2) | while read A
> do
>        echo $A | /usr/local/bin/nc oraclehost 8080
> done

If you're _really_ concerned about accuracy, you should use the output
from "ipf -z -f /etc/ipf.conf" rather than "ipfstat -aio".

Something like this:
cat /etc/ipf.conf | while read line; do
	foo=`echo $line | ipf -z -f -`
	echo "$foo" | sed "..." | /usr/local/bin/nc oraclehost 8080
done

Darren