summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-11-11 12:00:11 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2008-11-11 12:00:11 +0100
commit4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d (patch)
treeb92ab2dbac3bbec2f007e97a35d7efb374733563 /runtime
parentb104759ad671a1ae92f2768de02f1dbbe5f4cb12 (diff)
downloadrsyslog-4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d.tar.gz
rsyslog-4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d.tar.xz
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.c2
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 "";
}