Search for specific call in asterisk log files
Posted
by chiborg
on Server Fault
See other posts from Server Fault
or by chiborg
Published on 2010-04-21T15:21:25Z
Indexed on
2010/04/21
15:23 UTC
Read the original article
Hit count: 238
In my Asterisk log file, I have a line like this (truncated):
Executing [123@mycontext:1] Set("SIP/myhost-b7111840", "__INCOMINGCLI=4711")
Now I want to do the following filtering while looking at the log file with tail -f
:
- Match lines with a specific value for "INCOMINGCLI", storing the call ID (the
"SIP/myhost-b7111840"
part) - Output all subsequent lines that contain the call ID.
- As a bonus, having a grep-like option like
-A
would be nice.
I could do that easily in various programming languages, but how would I do it with standard UNIX commands like sed
or awk
? Can it be done with these commands?
© Server Fault or respective owner