summaryrefslogtreecommitdiff
path: root/template.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
committerMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
commit84080b58f8c6c5c040723a02503ddd90f02b5898 (patch)
treecf8c63e076f1ebb9cb2bea644a4f45172808a3e5 /template.h
parent53123ea8a1b9180b9aa0568e847f9245987c1b7c (diff)
downloadrsyslog-84080b58f8c6c5c040723a02503ddd90f02b5898.tar.gz
Imported Upstream version 3.20.2upstream/3.20.2
Diffstat (limited to 'template.h')
-rw-r--r--template.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/template.h b/template.h
index 0226420..318f3f3 100644
--- a/template.h
+++ b/template.h
@@ -47,7 +47,8 @@ struct template {
enum EntryTypes { UNDEFINED = 0, CONSTANT = 1, FIELD = 2 };
enum tplFormatTypes { tplFmtDefault = 0, tplFmtMySQLDate = 1,
- tplFmtRFC3164Date = 2, tplFmtRFC3339Date = 3, tplFmtPgSQLDate = 4 };
+ tplFmtRFC3164Date = 2, tplFmtRFC3339Date = 3, tplFmtPgSQLDate = 4,
+ tplFmtSecFrac = 5};
enum tplFormatCaseConvTypes { tplCaseConvNo = 0, tplCaseConvUpper = 1, tplCaseConvLower = 2 };
#include "msg.h"
@@ -67,7 +68,20 @@ struct templateEntry {
unsigned iToPos; /* up to that one... */
#ifdef FEATURE_REGEXP
regex_t re; /* APR: this is the regular expression */
- unsigned has_regex;
+ short has_regex;
+ short iMatchToUse;/* which match should be obtained (10 max) */
+ short iSubMatchToUse;/* which submatch should be obtained (10 max) */
+ enum {
+ TPL_REGEX_BRE = 0, /* posix BRE */
+ TPL_REGEX_ERE = 1 /* posix ERE */
+ } typeRegex;
+ enum {
+ TPL_REGEX_NOMATCH_USE_DFLTSTR = 0, /* use the (old style) default "**NO MATCH**" string */
+ TPL_REGEX_NOMATCH_USE_BLANK = 1, /* use a blank string */
+ TPL_REGEX_NOMATCH_USE_WHOLE_FIELD = 2, /* use the full field contents that we were searching in*/
+ TPL_REGEX_NOMATCH_USE_ZERO = 3 /* use 0 (useful for numerical values) */
+ } nomatchAction; /**< what to do if we do not have a match? */
+
#endif
unsigned has_fields; /* support for field-counting: field to extract */
unsigned char field_delim; /* support for field-counting: field delemiter char */