stucky
2007-04-28 08:52:22 UTC
Guys
Playing around with ng 2 and I started looking at the match filter again.
Simple question that I cannot find an answer to anywhere on the net.
How do I turn off case sensitivity for the match target ?
I'd like the following line to match "error' or 'ERROR' or 'Error'
filter logparse { match("error"); };
but of course it only matches 'error' since by default regex is case
sensitive.
Basically I'm trying to emulate 'grep -i'
I guess I could do this :
filter logparse { match("[Ee][Rr][Rr][Oo][Rr]"); }; but it'd be soo much
simpler to turn off case sensitivity.
And while we're talking regex. Shouldn't the above line actually read like
this :
filter logparse { match(".+error.+"); }; ?
meaning "anything followed by 'error' followed by anything"
Both appear to work so I assume the first line is interpreted by syslog-ng
like the second line correct ?
Help is appreciated
stucky
Playing around with ng 2 and I started looking at the match filter again.
Simple question that I cannot find an answer to anywhere on the net.
How do I turn off case sensitivity for the match target ?
I'd like the following line to match "error' or 'ERROR' or 'Error'
filter logparse { match("error"); };
but of course it only matches 'error' since by default regex is case
sensitive.
Basically I'm trying to emulate 'grep -i'
I guess I could do this :
filter logparse { match("[Ee][Rr][Rr][Oo][Rr]"); }; but it'd be soo much
simpler to turn off case sensitivity.
And while we're talking regex. Shouldn't the above line actually read like
this :
filter logparse { match(".+error.+"); }; ?
meaning "anything followed by 'error' followed by anything"
Both appear to work so I assume the first line is interpreted by syslog-ng
like the second line correct ?
Help is appreciated
stucky