Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-05-2004, 07:55 PM   #1
LQ Newbie
Registered: Nov 2004
Posts: 2

Rep: Reputation: 0
Events on Log analyse

Hello ! I'm French so sorry if my English isn't the best.

I would like to have a shell script making events analysing my logs in /var/log/

For example, by running tail -f /var/log/apache/access.log - I would like, for each GET requests, to run a command like /usr/bin/beep to make simple.

Thank you in advance !!
Old 11-07-2004, 02:00 PM   #2
Registered: Mar 2004
Posts: 41

Rep: Reputation: 15
Save the follow shell script as, then run:
chmod +x

Then run:
tail -f /var/log/apache/access.log | GET

The argument to is the string you want to match on. So if you wanted to look for HEAD requests instead of GET, run it like this:
tail -f /var/log/apache/access.log | HEAD

Or for a particular IP address:
tail -f /var/log/apache/access.log | ""

... You get the idea. Also, your English is quite good


while [ 1 ]; do
        read foo;
        echo $foo | grep "$1" > /dev/null 2>&1
        if [ $? -eq 0 ]; then

Last edited by mgatny; 11-07-2004 at 02:02 PM.
Old 11-07-2004, 02:20 PM   #3
LQ Newbie
Registered: Nov 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks a lot !

It works verry fine.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
help analyse grub types.h ewt3y Programming 1 08-14-2005 05:43 PM
is there any tool to analyse a core dump? jundu88 Programming 1 04-14-2005 03:04 PM
logfile analyse saavik Linux - Networking 4 03-30-2005 06:14 AM
Can anyone analyse this message? Fraxis Linux - Software 6 01-02-2002 07:36 PM
want help to analyse networking in kernel cybercop12us Programming 1 10-24-2001 04:15 PM

All times are GMT -5. The time now is 04:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration