This is perhaps more a linux question than an asterisk question, but in my defense I don't know too many linux programs that will happily flood the messages file the way asterisk does.

I have a minor error on a system that doesn't cause any problems, but when it happens it will write about a dozen messages per second to the log file. The error looks like this:

Jan  9 12:04:37 WARNING[19760] file.c: Unexpected control subclass '-1'

What I want to be able to do is run a cron job that'll look for the error message, and erase it from the log file (ideally I guess instead of erasing it, it would re-write it as one line, with the message "(occurred x times)" following, but that's quite a bit more fussy). Everything up to the 'file.c' part is variable, so I guess I'd want to search for lines containing "file.c: Unexpected control subclass '-1'", and put them somewhere else (or just get rid of them).

I figure this is very likely a one-liner for somebody who knows sed and regex well-enough, and before I started searching I figured I'd ask if anyone had a util that might be suitable. Seems to be something that's common enough that somebody might have a quick solutino.

Thanks in advance for any advice on this one.

Jim

--

--
Jim Van Meggelen
[email protected]
http://www.oreillynet.com/pub/au/2177

"A child is the ultimate startup, and I have three. This makes me rich."
                   Guy Kawasaki
--



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to