summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSebastien Ponce <sebastien.ponce_rsyslog@m4x.org>2012-12-03 09:12:44 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-12-03 09:12:44 +0100
commitbfae69d68b0032a383821a54bc52aeff36a90e52 (patch)
tree47ebbf17853567471524def63a97d4687c546e8f /plugins
parent62f6a7d7b4b3c9fee0fffea961a201d24a059b2c (diff)
downloadrsyslog-bfae69d68b0032a383821a54bc52aeff36a90e52.tar.gz
rsyslog-bfae69d68b0032a383821a54bc52aeff36a90e52.tar.bz2
rsyslog-bfae69d68b0032a383821a54bc52aeff36a90e52.zip
permit RFC3339 timestamp in local log socket messages
Released under ASL 2.0, permission given via email.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imuxsock/imuxsock.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index e0ba7dd9..871a1fa5 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -937,15 +937,19 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim
/* in this case, we still need to find out if we have a valid
* datestamp or not .. and advance the parse pointer accordingly.
*/
- datetime.ParseTIMESTAMP3164(&dummyTS, &parse, &lenMsg);
+ if (datetime.ParseTIMESTAMP3339(&dummyTS, &parse, &lenMsg) != RS_RET_OK) {
+ datetime.ParseTIMESTAMP3164(&dummyTS, &parse, &lenMsg);
+ }
} else {
- if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) {
+ if(datetime.ParseTIMESTAMP3339(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK &&
+ datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) {
DBGPRINTF("we have a problem, invalid timestamp in msg!\n");
}
}
} else { /* if we pulled the time from the system, we need to update the message text */
uchar *tmpParse = parse; /* just to check correctness of TS */
- if(datetime.ParseTIMESTAMP3164(&dummyTS, &tmpParse, &lenMsg) == RS_RET_OK) {
+ if(datetime.ParseTIMESTAMP3339(&dummyTS, &tmpParse, &lenMsg) == RS_RET_OK ||
+ datetime.ParseTIMESTAMP3164(&dummyTS, &tmpParse, &lenMsg) == RS_RET_OK) {
/* We modify the message only if it contained a valid timestamp,
* otherwise we do not touch it at all. */
datetime.formatTimestamp3164(&st, (char*)parse, 0);