summaryrefslogtreecommitdiffstats
path: root/runtime/msg.h
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2012-08-11 09:19:09 +0200
committerMiloslav Trmač <mitr@redhat.com>2012-08-28 10:26:42 +0200
commitf2068e080718f28b98034233ea08b50f3d2ab220 (patch)
tree0c0b875dfcbf09fe963b26054bf5d11d959e2edf /runtime/msg.h
parentee8e701cddaac8e786f388beff89b57f84a1a346 (diff)
downloadrsyslog-f2068e080718f28b98034233ea08b50f3d2ab220.tar.gz
rsyslog-f2068e080718f28b98034233ea08b50f3d2ab220.tar.xz
rsyslog-f2068e080718f28b98034233ea08b50f3d2ab220.zip
Handle $!all-json in field templates
Let msg.c handle appending fields, which also allows it to append more than one field per replaced property. The result allows supplementing CEE data with other (non-constant) properties, but will currently result in duplicates if $!all-json and the template contain fields with the same names. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'runtime/msg.h')
-rw-r--r--runtime/msg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/msg.h b/runtime/msg.h
index f6b54a77..345f2a9e 100644
--- a/runtime/msg.h
+++ b/runtime/msg.h
@@ -140,6 +140,11 @@ struct msg {
#define NEEDS_ACLCHK_U 0x080 /* check UDP ACLs after DNS resolution has been done in main queue consumer */
#define NO_PRI_IN_RAW 0x100 /* rawmsg does not include a PRI (Solaris!), but PRI is already set correctly in the msg object */
+struct fieldBuildingState {
+ struct templateField *fields;
+ size_t allocatedFields;
+ size_t nextField;
+};
/* function prototypes
*/
@@ -173,6 +178,9 @@ rsRetVal MsgReplaceMSG(msg_t *pThis, uchar* pszMSG, int lenMSG);
uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
propid_t propid, es_str_t *propName,
size_t *pPropLen, unsigned short *pbMustBeFreed);
+rsRetVal FBSensureSpace(struct fieldBuildingState *state);
+rsRetVal MsgAppendFields(msg_t *pMsg, struct templateEntry *pTpe,
+ struct fieldBuildingState *state);
char *textpri(char *pRes, size_t pResLen, int pri);
rsRetVal msgGetMsgVar(msg_t *pThis, cstr_t *pstrPropName, var_t **ppVar);
es_str_t* msgGetMsgVarNew(msg_t *pThis, uchar *name);