Skip to content

Instantly share code, notes, and snippets.

@dmnlk
Created September 16, 2014 06:03
Show Gist options
  • Select an option

  • Save dmnlk/9caf8aea372d132a4f28 to your computer and use it in GitHub Desktop.

Select an option

Save dmnlk/9caf8aea372d132a4f28 to your computer and use it in GitHub Desktop.
ssh→tailf→grep→hoge
#/bin/sh
post () {
while read i
do
echo $i | grep -q "403"
if [ $? = "0" ];then
echo $i;
fi
done
}
ssh someUser@HogeHost tail -n 1 -f '/usr/local/apache/log/access_log' | post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment