Sponsored Content
Top Forums UNIX for Dummies Questions & Answers AWK Output not working with tail -f Post 302356320 by jlliagre on Friday 25th of September 2009 07:00:20 AM
Old 09-25-2009
This should work:
Code:
tail -f alarms.log | awk '/CRITICAL_ALM/ {if ($12==8974) {system("date")}}'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Output from tail to a user

Hi all I've read through a few of these lists but can't find a right combination of answers (I can create VPN's but can't send an email!) Ok - I'm using taper as backup software which generates a log file called taper_log I want the last eight lines of this log file to be sent to a specified... (3 Replies)
Discussion started by: ifan
3 Replies

2. Shell Programming and Scripting

piping output of tail running in background

Not sure why this does not work in bash: tail -f err.log |& -bash: syntax error near unexpected token `&' I am attempting to continuously read a file that is being updated by doing a "tail -f" on the file and piping the output to stdin which can then be read by the next shell command Thnx (4 Replies)
Discussion started by: anuramdas
4 Replies

3. UNIX for Dummies Questions & Answers

why tail +n not working?

Hello at my home when i try tail +5 emp it works but when i try in my college it doesn't work! what can be the problem any idea? when i type man tail it gives me various options in which it's mentioned that tail +n can also work when you want to display from nth line. But... (3 Replies)
Discussion started by: salman4u
3 Replies

4. Shell Programming and Scripting

how to read tail -F command output in perl

Hi All, How I will read the output of the tail -F command in perl. I have text file with below contains file1.txt 1 2 3 4 $running=1; sub openLog($) { (my $log) = @_; (1 Reply)
Discussion started by: pravin27
1 Replies

5. UNIX for Advanced & Expert Users

How to alert if no output from tail -f command

Hi Dears, I am using AWK script to monitor some log files. My awk will get the input from the output of tail -f LOGFILE. (tail -f LOGFILE | myawkanalyzer) My doubt is, How can I notify, if I didn't get any output from the tail -f command. i.e) Log file stuck for some reason. I want to display... (1 Reply)
Discussion started by: sharif
1 Replies

6. Shell Programming and Scripting

copy tail output to an external file in perl

The below code works to tail client.log file. but I want to copy the output into an external file /home/tail.txt Can anyone please help. #!/opt/bin/perl -w open my $pipe, "-|", "/usr/bin/tail", "/var/log/client.log" or die "could not start tail on /var/log/client.log : $!"; print while... (2 Replies)
Discussion started by: sureshcisco
2 Replies

7. Shell Programming and Scripting

Help with getting a Ctrl-C trap working w/ a piped tail -f...

Hi All, Although each line below seems to work by itself, I've been having trouble getting the Control-C trap working when I add the "|perl -pe..." to the end of the tail -f line, below. (That |perl -pe statement basically just adds color to highlight the word "ERROR" while tailing a log... (2 Replies)
Discussion started by: chatguy
2 Replies

8. Shell Programming and Scripting

Weird tail output over ssh

Hello; Am trying to correct the formatting of tail output over ssh. Using the following code: echo "" > $FILE for BOX in $SERVERS do echo "Processing on $BOX" |tee -a $FILE echo "===============================" >> $FILE sudo ssh $BOX 'TERMINAL="vt100" /usr/bin/sh -s' <... (2 Replies)
Discussion started by: delphys
2 Replies

9. Shell Programming and Scripting

Count lines and words of a stream output with tail

Hello, I need to tail -f a file output stream and I need to get only lines that contains "get" and "point" in the same line. It doesn't matter the order. Then I need only the text BEFORE "point". I have to count each line and perform other serveral actions after this has performed 3 times.... (9 Replies)
Discussion started by: Kibou
9 Replies

10. UNIX for Dummies Questions & Answers

Tail -f | grep > output.txt

hi guys, I perform a sort of monitoring. I have a server running and with tail -f | grep "Searchstring"I monitor the log-file for recent specific entries. This is ok and works fine. Now, in addition I want to have my search results not posted into the shell but into a file. I tried: tail... (3 Replies)
Discussion started by: LaUs3r
3 Replies
LOGTOP(1)						      General Commands Manual							 LOGTOP(1)

NAME
logtop - Realtime log line rate analyser SYNOPSIS
logtop [OPTIONS] DESCRIPTION
logtop is a System Administrator tool analyzing line rate on stdin. It reads on stdin and print a constantly updated result displaying, in columns: Line number, count, frequency, and the actual line. $ tail -f FILE | logtop is the friendly version of: $ watch 'tail FILE | sort | uniq -c | sort -gr' OPTIONS
-s, --size=K Only keep K lines in memory, instead of 10000. -q, --quiet Do not display a live view of the data, only display a top at exit. -l, --line-by-line=K Print result line by line, in a machine friendly format, K is the number of result to print per line. Line by line format is : [%d %f %s ]* %d : Number of occurences %f : Frequency of apparition %s : String (Control chars replaced by dots. -i, --interval=K Interval between graphical updates, in seconds. Defaults to 1. -h, --help Show summary of options. -v, --version Show version of program. EXAMPLES
Here are some logtop usage examples. tail -f cache.log | grep -o "HIT|MISS" | logtop Realtime hit / miss ratio on some caching software log file. tail -f access.log | cut -d' ' -f1 | logtop -s 10000 Realtime most querying IPs on your server, as long as log lines in access.log starts with the client IP. tail -f access.log | cut -d' ' -f7 | logtop -s 10000 Realtime most requested web pages in a NCSA like log file. cat auth.log | grep -v "CRON" | grep -o ": .*" | logtop -q -s 100000 Display a one-shot simple analyse of your auth.log. SEE ALSO
watch(1) AUTHOR
logtop was written by Julien Palard. This manual page was written by Julien Palard <julien@palard.fr>, for the Debian project (and may be used by others). April 16, 2011 LOGTOP(1)
All times are GMT -4. The time now is 08:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy