summaryrefslogtreecommitdiffstats
path: root/template.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-03-29 18:04:12 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-03-29 18:04:12 +0200
commitb88ba949f8d657034f808034321fabbd65bf8078 (patch)
tree2cf7d0c34d4e9fa6db3625d0833382d74fe7b698 /template.c
parent3dccce084a65376b7555aec77c4cf1368cdd9cb7 (diff)
downloadrsyslog-b88ba949f8d657034f808034321fabbd65bf8078.zip
rsyslog-b88ba949f8d657034f808034321fabbd65bf8078.tar.gz
rsyslog-b88ba949f8d657034f808034321fabbd65bf8078.tar.xz
added "date-unixtimestamp" property replacer option to format as a unix timestamp
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 bcdcc36..2326819 100644
--- a/template.c
+++ b/template.c
@@ -521,6 +521,8 @@ static void doOptions(unsigned char **pp, struct templateEntry *pTpe)
pTpe->data.field.eDateFormat = tplFmtRFC3164BuggyDate;
} else if(!strcmp((char*)Buf, "date-rfc3339")) {
pTpe->data.field.eDateFormat = tplFmtRFC3339Date;
+ } else if(!strcmp((char*)Buf, "date-unixtimestamp")) {
+ pTpe->data.field.eDateFormat = tplFmtUnixDate;
} else if(!strcmp((char*)Buf, "date-subseconds")) {
pTpe->data.field.eDateFormat = tplFmtSecFrac;
} else if(!strcmp((char*)Buf, "lowercase")) {
@@ -1258,6 +1260,9 @@ void tplPrintList(rsconf_t *conf)
case tplFmtRFC3339Date:
dbgprintf("[Format as RFC3339-Date] ");
break;
+ case tplFmtUnixDate:
+ dbgprintf("[Format as Unix timestamp] ");
+ break;
default:
dbgprintf("[INVALID eDateFormat %d] ", pTpe->data.field.eDateFormat);
}