summaryrefslogtreecommitdiffstats
path: root/template.c
diff options
context:
space:
mode:
Diffstat (limited to 'template.c')
-rw-r--r--template.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/template.c b/template.c
index d9ca071..298f813 100644
--- a/template.c
+++ b/template.c
@@ -669,6 +669,8 @@ static void doOptions(unsigned char **pp, struct templateEntry *pTpe)
} else {
pTpe->data.field.options.bJSONf = 1;
}
+ } else if(!strcmp((char*)Buf, "optional-field")) {
+ pTpe->data.field.options.bOptionalField = 1;
} else {
dbgprintf("Invalid field option '%s' specified - ignored.\n", Buf);
}
@@ -1984,6 +1986,9 @@ void tplPrintList(rsconf_t *conf)
if(pTpe->data.field.options.bJSONf) {
dbgprintf("[format as JSON field] ");
}
+ if(pTpe->data.field.options.bOptionalField) {
+ dbgprintf("[optional field - skip in field template if not present] ");
+ }
if(pTpe->data.field.options.bDropLastLF) {
dbgprintf("[drop last LF in msg] ");
}