[TNM] syslog parsing

Ben Chobot bench at silentmedia.com
Wed Mar 6 19:38:01 UTC 2013


I've noticed for a while now that sometimes tail_n_mail squashes my log lines in an ugly way. I've finally tracked this down to the way that it deals with syslog lines.

If I have a log file that looks like:

2013-03-01T02:19:28.594110+00:00 pgdb27 postgres[16497]: [7-1] foo
2013-03-01T02:19:28.594134+00:00 pgdb27 postgres[16497]: [7-2] bar
2013-03-01T03:19:28.594110+00:00 pgdb27 postgres[16497]: [7-1] baz

...then tail_n_mail will squash all three lines together into the same line, despite them quite clearly being two separate statements. Looking at the code, it seems that tail_n_mail is intentionally ignoring the line number in the [7-N] part of the line identifier. Is there a good reason it's not moving on to the next statement if N decreases?



More information about the TNM mailing list