diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-04 11:06:25 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-04 11:06:25 +0200 |
commit | aa8c79794e00c42ef3b89753f38cef511abb90b3 (patch) | |
tree | 93ddacb7e0d3e4075e0c8074928382588bea9d2a /runtime/msg.c | |
parent | 493ddeaa770de41ab5a6bb5279eed355c84b12ee (diff) | |
parent | ddea340e665a657bc6be88176130d1221c0dec3d (diff) | |
download | rsyslog-aa8c79794e00c42ef3b89753f38cef511abb90b3.tar.gz rsyslog-aa8c79794e00c42ef3b89753f38cef511abb90b3.tar.bz2 rsyslog-aa8c79794e00c42ef3b89753f38cef511abb90b3.zip |
Merge branch 'master' into master-newruleset
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index a89a01d2..afc79042 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2420,16 +2420,20 @@ getCEEPropVal(msg_t *pM, es_str_t *propName, uchar **pRes, int *buflen, unsigned if(*pbMustBeFreed) free(*pRes); *pRes = NULL; -dbgprintf("AAAA: enter getCEEProp\n"); +dbgprintf("AAAA: enter getCEEPropVal\n"); // TODO: mutex? if(pM->json == NULL) goto finalize_it; - name = (uchar*)es_str2cstr(propName, NULL); + if(!es_strbufcmp(propName, (uchar*)"!", 1)) { + field = pM->json; + } else { + name = (uchar*)es_str2cstr(propName, NULL); dbgprintf("AAAA: name to search '%s'\n", name); - leaf = jsonPathGetLeaf(name, ustrlen(name)); + leaf = jsonPathGetLeaf(name, ustrlen(name)); dbgprintf("AAAA: leaf '%s'\n", leaf); - CHKiRet(jsonPathFindParent(pM, name, leaf, &parent, 1)); - field = json_object_object_get(parent, (char*)leaf); + CHKiRet(jsonPathFindParent(pM, name, leaf, &parent, 1)); + field = json_object_object_get(parent, (char*)leaf); + } *pRes = (uchar*) strdup(json_object_get_string(field)); dbgprintf("AAAA: json_object_get_string() returns '%s'\n", *pRes); *buflen = (int) ustrlen(*pRes); @@ -2462,6 +2466,10 @@ dbgprintf("AAAA: enter getCEEPropJSON\n"); ABORT_FINALIZE(RS_RET_NOT_FOUND); } + if(!es_strbufcmp(propName, (uchar*)"!", 1)) { + *pjson = pM->json; + FINALIZE; + } name = (uchar*)es_str2cstr(propName, NULL); dbgprintf("AAAA: name to search '%s'\n", name); leaf = jsonPathGetLeaf(name, ustrlen(name)); |