Any one have an example of a glob character range for matching a value? match("*[0-9]" value ("MSG") type ("glob") ) The above should match Dog 1 Dog 2 Dog 3
syslog-ng uses glib's glob implmentation and I'm not sure that supports character ranges. ----- Original message -----
Any one have an example of a glob character range for matching a value?
match("*[0-9]" value ("MSG") type ("glob") )
The above should match
Dog 1 Dog 2 Dog 3
Doing a "man glob" shows it can do ranges. And I thought i read some Syslog-ng doc that said it could do it too? On Jul 20, 2012 9:55 PM, "Balazs Scheidler" <bazsi77@gmail.com> wrote:
**
syslog-ng uses glib's glob implmentation and I'm not sure that supports character ranges.
----- Original message -----
Any one have an example of a glob character range for matching a value?
match("*[0-9]" value ("MSG") type ("glob") )
The above should match
Dog 1 Dog 2 Dog 3
"T. A. Smooth" <catdaaaady@gmail.com> writes:
Doing a "man glob" shows it can do ranges. And I thought i read some Syslog-ng doc that said it could do it too?
glob does support ranges, but glib's glob[1] sadly does not. If the syslog-ng docs say somewhere it does, that is unfortunately a documentation bug. [1]: http://developer.gnome.org/glib/unstable/glib-Glob-style-pattern-matching.ht... As an alternative, you can use regexps - a bit costier, but for a simple regex, hopefully not by much. On another hand, not supporting ranges is suprising, and in other parts of the code, syslog-ng already uses plain old glob().. it might be worth considering switching the matching code over too, at some point. -- |8]
I found the part of the doc. http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.3-guide... I see this in docs 3.1 and up. Don't see it in 3.0 though. I am testing on 3.2.5. Has anyone gotten glob character ranges to work ? :-) I may go regex in the end. But I do have a concern about performance. So I want to be sure glob ranges are broken/unsupported or something else before I move on.
glob
Description: Use glob patterns (that is, wildcards and character ranges) without regular expression support. The advantage of glob patterns to regular expressions is that globs can be processed much faster. For details on glob patterns, see the *glob manual page* (man glob).
On Fri, Jul 20, 2012 at 11:20 PM, Gergely Nagy <algernon@balabit.hu> wrote:
"T. A. Smooth" <catdaaaady@gmail.com> writes:
Doing a "man glob" shows it can do ranges. And I thought i read some Syslog-ng doc that said it could do it too?
glob does support ranges, but glib's glob[1] sadly does not. If the syslog-ng docs say somewhere it does, that is unfortunately a documentation bug.
[1]: http://developer.gnome.org/glib/unstable/glib-Glob-style-pattern-matching.ht...
As an alternative, you can use regexps - a bit costier, but for a simple regex, hopefully not by much.
On another hand, not supporting ranges is suprising, and in other parts of the code, syslog-ng already uses plain old glob().. it might be worth considering switching the matching code over too, at some point.
-- |8]
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
In this particular case can you use "* [0123456789]" for your match. Gets around the performance concern of regex Evan. ________________________________________ From: syslog-ng-bounces@lists.balabit.hu [syslog-ng-bounces@lists.balabit.hu] On Behalf Of T. A. Smooth [catdaaaady@gmail.com] Sent: Saturday, July 21, 2012 12:43 PM To: Syslog-ng users' and developers' mailing list Subject: Re: [syslog-ng] Glob character ranges I found the part of the doc. http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.3-guide... I see this in docs 3.1 and up. Don't see it in 3.0 though. I am testing on 3.2.5. Has anyone gotten glob character ranges to work ? :-) I may go regex in the end. But I do have a concern about performance. So I want to be sure glob ranges are broken/unsupported or something else before I move on. glob Description: Use glob patterns (that is, wildcards and character ranges) without regular expression support. The advantage of glob patterns to regular expressions is that globs can be processed much faster. For details on glob patterns, see the glob manual page (man glob). On Fri, Jul 20, 2012 at 11:20 PM, Gergely Nagy <algernon@balabit.hu<mailto:algernon@balabit.hu>> wrote: "T. A. Smooth" <catdaaaady@gmail.com<mailto:catdaaaady@gmail.com>> writes:
Doing a "man glob" shows it can do ranges. And I thought i read some Syslog-ng doc that said it could do it too?
glob does support ranges, but glib's glob[1] sadly does not. If the syslog-ng docs say somewhere it does, that is unfortunately a documentation bug. [1]: http://developer.gnome.org/glib/unstable/glib-Glob-style-pattern-matching.ht... As an alternative, you can use regexps - a bit costier, but for a simple regex, hopefully not by much. On another hand, not supporting ranges is suprising, and in other parts of the code, syslog-ng already uses plain old glob().. it might be worth considering switching the matching code over too, at some point. -- |8] ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
Listing out the range doesn't seem to help either. Anyone use this feature? On Jul 21, 2012 4:14 PM, "Evan Rempel" <erempel@uvic.ca> wrote:
In this particular case can you use
"* [0123456789]"
for your match. Gets around the performance concern of regex
Evan. ________________________________________ From: syslog-ng-bounces@lists.balabit.hu [ syslog-ng-bounces@lists.balabit.hu] On Behalf Of T. A. Smooth [ catdaaaady@gmail.com] Sent: Saturday, July 21, 2012 12:43 PM To: Syslog-ng users' and developers' mailing list Subject: Re: [syslog-ng] Glob character ranges
I found the part of the doc.
http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.3-guide...
I see this in docs 3.1 and up. Don't see it in 3.0 though. I am testing on 3.2.5. Has anyone gotten glob character ranges to work ? :-) I may go regex in the end. But I do have a concern about performance. So I want to be sure glob ranges are broken/unsupported or something else before I move on. glob
Description: Use glob patterns (that is, wildcards and character ranges) without regular expression support. The advantage of glob patterns to regular expressions is that globs can be processed much faster. For details on glob patterns, see the glob manual page (man glob).
On Fri, Jul 20, 2012 at 11:20 PM, Gergely Nagy <algernon@balabit.hu <mailto:algernon@balabit.hu>> wrote: "T. A. Smooth" <catdaaaady@gmail.com<mailto:catdaaaady@gmail.com>> writes:
Doing a "man glob" shows it can do ranges. And I thought i read some Syslog-ng doc that said it could do it too?
glob does support ranges, but glib's glob[1] sadly does not. If the syslog-ng docs say somewhere it does, that is unfortunately a documentation bug.
[1]: http://developer.gnome.org/glib/unstable/glib-Glob-style-pattern-matching.ht...
As an alternative, you can use regexps - a bit costier, but for a simple regex, hopefully not by much.
On another hand, not supporting ranges is suprising, and in other parts of the code, syslog-ng already uses plain old glob().. it might be worth considering switching the matching code over too, at some point.
-- |8]
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
On Mon, Jul 23, 2012 at 8:41 PM, T. A. Smooth <catdaaaady@gmail.com> wrote:
Listing out the range doesn't seem to help either. Anyone use this feature?
Like I said, glib's glob implementation which syslog-ng uses, does not support ranges. If the docs say otherwise, the docs are buggy. So your only options are regexps and explicitly listing all the chars in the range. Or if you're feeling adventurous, you could try to patch syslog-ng to use glob instead of glib's pattern matching thing. ;) -- |8]
participants (5)
-
Balazs Scheidler
-
Evan Rempel
-
Gergely Nagy
-
Gergely Nagy
-
T. A. Smooth