Hi
I'd like to achieve the ff functionality;
tail -f log | grep keyword ...... and then perform a function.
That is, I like to tail a log and when a certain keyword appears I then want my script to play an audio file for example.
Any ideas??
Cheers
M (1 Reply)
Hi,
I am having issue where I have to tail 3 log files continuously (forever) and while I am reading the files , parse them and shove the data into DB. I can do this with one file totally fine but how can I read 3 files at the same time? I am not really looking for code (but would be nice) but... (3 Replies)
Guys,
I do have a script that runs to take the server out from network, after running the script it is writing the new log file{outFile} in to directory . Now what i need is my script should tail the last modified file{outFile} & search the string {Server Status} ans should echo the same at the... (0 Replies)
I have a log file which contains data like this
This log file is updated twice a day at 7am and 6pm,
I want a script(which i will make run at 7:10am and 6:10pm) which should fetch only the last appended lines since last update..
I mean.. if i execute the script at 7.10am 3/3/2010
it... (4 Replies)
Hi.
I have a log file which gets updated by a java process and it uses ASCII STX and ETX characters (i.e CTRL-B and CTRL-C characters) to demarcate each XML message logged.
so the format of the file is something like
STX XML_MESSAGE1
..
..
ETX STX XML_MESSAGE2
..
..
ETX
each XML... (4 Replies)
tail -f /var/log/syslog | egrep -c FATAL
is there a way to do the above and actually have the number of lines matching the pattern increment as it is logged to the log file?
for instance, when you invoke a command like the one i just posted, you'll not get the total lines unless you do... (4 Replies)
Hi
Please help me in finding a solution for tailing multiple log files and writing all of them into one common file.
I have 4 log files with same name in 4 different folders.
Whenever I post a Request - any one of these 4 log files gets updated with some log detail in the below format :
... (5 Replies)
if the last line of an output contains a certain string 'FAILED', i want to print 200 lines from the output.
here's where I got stuck:
process blah blah blah | awk '{if ($0 ~ /FAILED/) y=x "\n" $0; x=$0};END{print y}'
the above only prints the last 2 lines, and it also searches the... (19 Replies)
Heyas
Figured me had a 'typo' in tui-conf-set, i went to fix it.
Now, i also figured, it might be nice to have tui-conf-set report (to console, not only exit code) wether it could save the variable to the file or not.
This said, I appended this code: (the tui-title and tui-echo lines are... (3 Replies)
Heyas
I am trying to remove a tailing space, with substitution.
Already tried some multiple escapes with no luck, is that even possible?
echo $CHROOT
|| \
CHROOT="${CHROOT/\/$}"
echo $CHROOT
return
And all i get is:
:) paths $ CHROOT=/usr/local/
+ paths $ . *
/usr/local/
/usr/local/... (2 Replies)
Discussion started by: sea
2 Replies
LEARN ABOUT DEBIAN
since
SINCE(1) User Manuals SINCE(1)NAME
since - display content of a file since the last time
SYNOPSIS
since [-aefhlmnqvxz] [-d seconds] [-s file] files
DESCRIPTION
since is a utility designed to monitor log files. since is similar to tail(2) as it also displays information appended to a file. However
since only displays the data which has been added since the last time since was run. If since is run on a particular file for the first
time, then the entire file is displayed.
EXAMPLE
since /var/log/apache/{access,error}_log > /dev/null
lynx --dump http://localhost/ > /dev/null
since /var/log/apache/{access,error}_log
OPTIONS -a Make updates to the since state files atomic. This option configures since to use a temporary file and a rename(2) instead of updat-
ing the state file in situ.
-d seconds
Specify the number of integer seconds to wait between polling files for changes. This option is only relevant in conjunction with
the -f option and if the inotify mechanism is not being used.
-e Print the header lines to standard error instead of standard output.
-f Follow the specified files. This option is analogous to tail -f as the files are also polled for changes until the process is inter-
rupted.
-h Print a terse help message.
-l Relaxed mode. If some data files are inaccessible since will not fail completely.
-m Disable mmap(2), use read(2) instead to access state and data files. Note that for certain smaller io operations read(2) may be
used even if this option has not been given.
-n Do not update the .since file which keeps track of file growth.
-q Make the utility operate more quietly.
-s filename
Specify the state file explicitly. Using this option will also disable the use of fallback state files.
-v Increase the verbosity. This option can be given multiple times.
-x Ignore file arguments which have compressed extensions.
-z Discard output. Similar to redirecting the output to /dev/null, but faster. If used in conjunction with the -f option, only the ini-
tial output will be discarded.
FILES
.since
State file recording the length of the previously displayed files. The location of the file can be set on the command line using
the -s option. If this option is not given, since will check the SINCE environment variable for the location of the state file. If
the SINCE environment variable has not been set since will use the HOME environment variable and store the information in the file
$HOME/.since. If the HOME variable is not set, since will use a getpwuid(3) lookup. If all these fail will use the file /tmp/since.
BUGS
since uses the inode of a file as its key, if that inode is recycled since will get confused. since is not particularly efficient when
storing or looking up the stat(2) information. Functionality equivalent to since can probably be achieved with a number of trivial shell
scripts.
COPYING
since may only be used, distributed and modified in accordance with the terms of the GPL (GNU General Public License) version 3 or newer as
published by the FSF (Free Software Foundation).
SEE ALSO tail(1), stat(2).
Linux JULY 1998 SINCE(1)