diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-03-29 18:04:12 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-03-29 18:04:12 +0200 |
commit | b88ba949f8d657034f808034321fabbd65bf8078 (patch) | |
tree | 2cf7d0c34d4e9fa6db3625d0833382d74fe7b698 /template.c | |
parent | 3dccce084a65376b7555aec77c4cf1368cdd9cb7 (diff) | |
download | rsyslog-b88ba949f8d657034f808034321fabbd65bf8078.tar.gz rsyslog-b88ba949f8d657034f808034321fabbd65bf8078.tar.xz rsyslog-b88ba949f8d657034f808034321fabbd65bf8078.zip |
added "date-unixtimestamp" property replacer option to format as a unix timestamp
Diffstat (limited to 'template.c')
-rw-r--r-- | template.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); } |