On 11/05/12 09:49, Barry Samuels wrote:
I want to set up a logcheck ignore expression to ignore the following:
kernel: [220359.596744] [drm] nouveau 0000:06:00.0: Setting dpms mode 0 on tmds encoder (output 2)
The 220359.596744 number varies and so does the single mode digit, 0 in this instance, but the rest doesn't change.
I found the following documentation helpful: http://www.agentbob.info/agentbob/g3/83-AB.html
.. albeit useless without knowing regexs. But without a logcheck install to test with, I'd guess at a rule along the lines of:
^kernel: [[0-9.]{13}] [drm] [[:almun:]]+ [0-9:.]{12}: Setting dpms mode
Reading left to right: ^kernel: = start of line (^) followed by the text "kernel: " [ = open square bracket, escaped because [ means something in a regex [0-9.]{13} = anything in the square brackets (in this case digits 0 to 9 or ".", again escaped because "." has special meaning), 13 of them (to match 220359.596744) ] [drm] = matches "] [drm] " [[:alnum:]]+ = matches one or more ("+") alphanumerics (to pick up "nouveau" - I could have just put "nouveau" directly but doing it this way would match a different driver too, provided it just used alphanumerics anyway!) [9-9:.]{12} = 12 of the characters in the square brackets to match 0000:06:00.0 : Setting dpms mode = direct text match
As I didn't restrict the match to the full line (by ending the regex with $ to match end of line), the expression doesn't care what happens after that.
Of-course the trick with these things is only to exclude the ones you want to lose without catching others that you want. So if you wanted to literally only match the lines you describe it would be simpler: ^kernel: [[0-9.]{13}] [drm] noveau 0000:06:00.0: Setting dpms mode [0-9]+ on tmds encoder (output 2)$
With a bit of luck those should get you started, and like I said at the start they're untested.
Mark