Thursday, June 4, 2009

[BLUG] Grepping the output from the Asterisk console

Does anyone out there know of a way to feed the output from "asterisk -r" to stdout so that I can grep it for certain events? I was trying to troubleshoot a problem yesterday, and it would have been extremely.

I did try:

on screen 1
asterisk -r > /tmp/asterisk_output.txt

on screen 2
tail -f /tmp/asterisk_output.txt | grep <pattern>

but whenever a pattern was matched (or so I suspect), grep would complain about the source being a binary file.

--Kirk

No comments: