diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-11-11 12:00:11 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-11-11 12:00:11 +0100 |
commit | 4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d (patch) | |
tree | b92ab2dbac3bbec2f007e97a35d7efb374733563 /runtime | |
parent | b104759ad671a1ae92f2768de02f1dbbe5f4cb12 (diff) | |
download | rsyslog-4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d.tar.gz rsyslog-4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d.tar.bz2 rsyslog-4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d.zip |
enhance: regex nomatch option "ZERO" has been added
This allows to return the string 0 if a regular expression is
not found. This is probably useful for storing numerical values into
database columns.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/msg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index fcd4a6d3..c8dbf2c2 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -1936,6 +1936,8 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, } if(pTpe->data.field.nomatchAction == TPL_REGEX_NOMATCH_USE_DFLTSTR) return "**NO MATCH**"; + else if(pTpe->data.field.nomatchAction == TPL_REGEX_NOMATCH_USE_ZERO) + return "0"; else return ""; } |