summaryrefslogtreecommitdiffstats
path: root/plugins/ommongodb/ommongodb.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-22 17:55:35 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-22 17:55:35 +0200
commit7d39740b3d88dbd0432806e5f8da32c49cdb69f1 (patch)
tree452e5e27c13b49c5b1910f70a283e3a533ee1283 /plugins/ommongodb/ommongodb.c
parente4e19176298d6ac76c463565fa192c2349731156 (diff)
downloadrsyslog-7d39740b3d88dbd0432806e5f8da32c49cdb69f1.tar.gz
rsyslog-7d39740b3d88dbd0432806e5f8da32c49cdb69f1.tar.bz2
rsyslog-7d39740b3d88dbd0432806e5f8da32c49cdb69f1.zip
refactor: use common code for message property description processing
in all cases except script var access -- this comes next...
Diffstat (limited to 'plugins/ommongodb/ommongodb.c')
-rw-r--r--plugins/ommongodb/ommongodb.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/ommongodb/ommongodb.c b/plugins/ommongodb/ommongodb.c
index 85f09d1b..78781c08 100644
--- a/plugins/ommongodb/ommongodb.c
+++ b/plugins/ommongodb/ommongodb.c
@@ -235,12 +235,18 @@ getDefaultBSON(msg_t *pMsg)
int severity, facil;
gint64 ts_gen, ts_rcv; /* timestamps: generated, received */
int secfrac;
-
- procid = MsgGetProp(pMsg, NULL, PROP_PROGRAMNAME, NULL, 0, &procid_len, &procid_free, NULL);
- tag = MsgGetProp(pMsg, NULL, PROP_SYSLOGTAG, NULL, 0, &tag_len, &tag_free, NULL);
- pid = MsgGetProp(pMsg, NULL, PROP_PROCID, NULL, 0, &pid_len, &pid_free, NULL);
- sys = MsgGetProp(pMsg, NULL, PROP_HOSTNAME, NULL, 0, &sys_len, &sys_free, NULL);
- msg = MsgGetProp(pMsg, NULL, PROP_MSG, NULL, 0, &msg_len, &msg_free, NULL);
+ msgPropDescr_t cProp; /* we use internal implementation knowledge... */
+
+ cProp.id = PROP_PROGRAMNAME;
+ procid = MsgGetProp(pMsg, NULL, &cProp, &procid_len, &procid_free, NULL);
+ cProp.id = PROP_SYSLOGTAG;
+ tag = MsgGetProp(pMsg, NULL, &cProp, &tag_len, &tag_free, NULL);
+ cProp.id = PROP_PROCID;
+ pid = MsgGetProp(pMsg, NULL, &cProp, &pid_len, &pid_free, NULL);
+ cProp.id = PROP_HOSTNAME;
+ sys = MsgGetProp(pMsg, NULL, &cProp, &sys_len, &sys_free, NULL);
+ cProp.id = PROP_MSG;
+ msg = MsgGetProp(pMsg, NULL, &cProp, &msg_len, &msg_free, NULL);
// TODO: move to datetime? Refactor in any case! rgerhards, 2012-03-30
ts_gen = (gint64) datetime.syslogTime2time_t(&pMsg->tTIMESTAMP) * 1000; /* ms! */