summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-03-04 18:22:48 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-03-04 18:22:48 +0100
commit5005bce38763051b5b12e48ac60c3ff17097a952 (patch)
tree9e8519e33c0e530791768cb28882679446703505 /tools
parent924ceb305dc1dced54beaa6ffe4b72b9f2609c6a (diff)
downloadrsyslog-5005bce38763051b5b12e48ac60c3ff17097a952.tar.gz
rsyslog-5005bce38763051b5b12e48ac60c3ff17097a952.tar.xz
rsyslog-5005bce38763051b5b12e48ac60c3ff17097a952.zip
added ERE support in filter conditions
new comparison operation "ereregex"
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c7
-rw-r--r--tools/syslogd.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 9ced4562..6b8ce82f 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1071,7 +1071,12 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce
break;
case FIOP_REGEX:
if(rsCStrSzStrMatchRegex(f->f_filterData.prop.pCSCompValue,
- (unsigned char*) pszPropVal) == 0)
+ (unsigned char*) pszPropVal, 0) == RS_RET_OK)
+ bRet = 1;
+ break;
+ case FIOP_EREREGEX:
+ if(rsCStrSzStrMatchRegex(f->f_filterData.prop.pCSCompValue,
+ (unsigned char*) pszPropVal, 1) == RS_RET_OK)
bRet = 1;
break;
default:
diff --git a/tools/syslogd.h b/tools/syslogd.h
index e866a16b..f1b11a91 100644
--- a/tools/syslogd.h
+++ b/tools/syslogd.h
@@ -70,7 +70,8 @@ struct filed {
FIOP_CONTAINS = 1, /* contains string? */
FIOP_ISEQUAL = 2, /* is (exactly) equal? */
FIOP_STARTSWITH = 3, /* starts with a string? */
- FIOP_REGEX = 4 /* matches a regular expression? */
+ FIOP_REGEX = 4, /* matches a (BRE) regular expression? */
+ FIOP_EREREGEX = 5 /* matches a ERE regular expression? */
} operation;
cstr_t *pCSCompValue; /* value to "compare" against */
char isNegated; /* actually a boolean ;) */