#!/bin/bash

###############################
FILTER=$(readlink -e $0)-filter
LOGSRC=~/log/httpd-access.log
LOGDST=~/log/$(basename $0).log
###############################

tail -F -n 0 $LOGSRC | while read t1 t2 ip cmd url proto err len
do
# echo "t1=[$t1] t2=[$t2] ip=[$ip] cmd=[$cmd] url=[$url] proto=[$proto] err=[$err] len=[$len]"
  if [ -f $FILTER$url ]
  then
    echo -n "$t1 $t2 $ip - "; source $FILTER$url
  fi &>> $LOGDST
done
