summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--doc/property_replacer.html2
-rw-r--r--plugins/ommongodb/ommongodb.c5
-rw-r--r--runtime/msg.c4
4 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c6ec59f..6b96d35b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,18 @@ Version 6.4.1 [V6-STABLE] 2012-08-??
This lead to queue file corruption. While the root cause is a config
error, it is a bug that this important and hard to find config error
was not detected by rsyslog.
+- bugfix: "jsonf" property replacer option did generate invalid JSON
+ in JSON, we have "fieldname":"value", but the option emitted
+ "fieldname"="value". Interestingly, this was accepted by a couple
+ of sinks, most importantly elasticsearch. Now the correct format is
+ emitted, which causes a remote chance that some things that relied on
+ the wrong format will break.
+ Thanks to Miloslav Trmač for the patch
+- change $!all-json did emit an empty (thus non-JSON) string if no libee
+ data was present. It now emits {} and thus valid JSON. There is a
+ small risk that this may break some things that relied on the previous
+ inconsistency.
+ Thanks to Miloslav Trmač for the patch
---------------------------------------------------------------------------
Version 6.4.0 [V6-STABLE] 2012-08-20
- THIS IS THE FIRST VERSION OF THE 6.4.x STABLE BRANCH
diff --git a/doc/property_replacer.html b/doc/property_replacer.html
index 4c92bf4c..86a07474 100644
--- a/doc/property_replacer.html
+++ b/doc/property_replacer.html
@@ -368,7 +368,7 @@ The json option cannot be used together with either jsonf or csv options.
This signifies that the property should be expressed as a json <b>f</b>ield.
That means not only the property is written, but rather a complete json field in
the format<br>
-"fieldname"="value"</b>
+"fieldname":"value"</b>
where "filedname" is the assigend field name (or the property name if none was assigned)
and value is the end result of property replacer operation. Note that value supports
all property replacer options, like substrings, case converson and the like.
diff --git a/plugins/ommongodb/ommongodb.c b/plugins/ommongodb/ommongodb.c
index 39e2e4f9..00afcf68 100644
--- a/plugins/ommongodb/ommongodb.c
+++ b/plugins/ommongodb/ommongodb.c
@@ -120,6 +120,7 @@ ENDfreeInstance
BEGINdbgPrintInstInfo
CODESTARTdbgPrintInstInfo
/* nothing special here */
+ (void)pData;
ENDdbgPrintInstInfo
@@ -139,6 +140,8 @@ reportMongoError(instanceData *pData)
errmsg.LogError(0, RS_RET_ERR, "ommongodb: we had an error, but can "
"not obtain specifics");
}
+#else
+ (void)pData;
#endif
}
@@ -340,7 +343,7 @@ CODESTARTnewActInst
if(!strcmp(actpblk.descr[i].name, "server")) {
pData->server = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
} else if(!strcmp(actpblk.descr[i].name, "serverport")) {
- pData->port = (int) pvals[i].val.d.n, NULL;
+ pData->port = (int) pvals[i].val.d.n;
} else if(!strcmp(actpblk.descr[i].name, "db")) {
pData->db = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
} else if(!strcmp(actpblk.descr[i].name, "collection")) {
diff --git a/runtime/msg.c b/runtime/msg.c
index 891907ec..5fad8ea5 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2518,7 +2518,7 @@ jsonField(struct templateEntry *pTpe, uchar **ppRes, unsigned short *pbMustBeFre
dst = es_newStr(buflen+es_strlen(pTpe->fieldName)+15);
es_addChar(&dst, '"');
es_addStr(&dst, pTpe->fieldName);
- es_addBufConstcstr(&dst, "\"=\"");
+ es_addBufConstcstr(&dst, "\":\"");
CHKiRet(jsonAddVal(pSrc, buflen, &dst));
es_addChar(&dst, '"');
@@ -2734,7 +2734,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
if(pMsg->event == NULL) {
if(*pbMustBeFreed == 1)
free(pRes);
- pRes = (uchar*) "";
+ pRes = (uchar*) "{}";
*pbMustBeFreed = 0;
} else {
ee_fmtEventToJSON(pMsg->event, &str);