Hi,
this is the one and only documentation for audiolog by now.
WHAT IS AUDIOLOG
Audiolog is a little tool for analysing traces or logfiles in realtime and producing sound events. It always read line by line from standard input. In a configuration file you configure regular expressions. If audiolog reads a line matching a certain expression, it plays a note. You can specify the pitch and duration of that note. Also you can specify a .wav-file, but there are still some bugs in the .wav-output code, so don't wonder, if it sounds a bit strange...
What is special about audiolog and why not use logsurfer in combination with wavplay? Here is the answer: Audiolog is specialized for realtime events:
- Multiple events are recognized at the same time. Multiple sound can be played in parallel.
- The latency is very short. Its able to distinguish events occuring at rates of 20 per second and even more.
USAGE
If you call audiolog without parameters, it tries to open /etc/audiolog.conf, which is normally not existant. Better write a small configuration file and specify it with -c FILE. Then use tcpdump or another tracer to produce the output to be scanned. Example:
tcpdump -nl | audiolog -c /usr/share/audiolog/ping.al
AUDIOLOG WRAPPER
The most conveniant way to use audiolog is via the audiolog wrapper "alw". Just type "alw". It will output a list of predifined configurations. Pick one and call alw with the configuration mode as argument, for example:
linux:~ # alw net
Audiolog automatically calls tcpdump and uses /usr/share/audiolog/net.al as configurtation file. You will be able to hear your network traffic :-)!
CONFIGURATION FILE SYNTAX
Please look into /usr/share/audiolog for examples.
Text between '#' and end of line is ignored. Empty lines are ignored, too.
Each line contains a command to be followed by parameters. Quotes and backslashes how no special meaning. All characters are taken literally, with the exception of:
- leading spaces
- trailling spaces
- the linefeed at the end of the line
which will be ignored.
- Example
# ======================================================================
match echo request
play sine 1000 0.10
match echo reply
play sine 2000 0.10
# ======================================================================
Each command begins with a keyword, which may have parameters.
COMMANDS
match
Specifies an extended regular expression lines need to
match. No quotes
are needed nor supported. All spaces between match
and the first non-space character are ignored and
not accounted for the expression. Other spaces are
taken literally. So the following two lines match
different loglines:
match echo request
match echo request
exclude
Specifies an extended regular expression that the
line must not match.
continue
Normally the rule processing is aborted after the
first match. If you set continue (before the play
command ending the rule!) then the processing is
continued, so that more than one rule may match
and play a sound.
play
Plays a sound, if the line matches the previous expression
specified with match and does not match the expression
specified with exclude. After that a new rule definition
starts.
The first parameter is the sound type.
currently supported is only "sine". After sine are
two numbers: the pitch in Hz and the duration in seconds.
Expample:
play sine 440 0.5 # play sine note pitch 440 Hz duration 0.5 seconds
Important to know: The playing of the note does not delay
the further processing!
audiolog and alw are aborted by CTRL-C or kill. That's all. So have a lot of fun with the thing.
Mathias Kettner
audiolog@mathias-kettner.de
http://mathias-kettner.de/audiolog.html
