From 33713481095660a3bc2e220961c21f385c2d1765 Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Mon, 5 Nov 2012 12:09:13 +0100 Subject: Added imkmsg^imklog to imkmsg documentation. --- doc/imkmsg.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/imkmsg.html b/doc/imkmsg.html index 61068d09..23b96147 100644 --- a/doc/imkmsg.html +++ b/doc/imkmsg.html @@ -25,9 +25,11 @@ Log messages are parsed as necessary into rsyslog msg_t structure. Continuation as json key/value pairs and added into rsyslog's message json representation.

Configuration Directives:

-This module has no configuration directives. +

This module has no configuration directives.

Caveats/Known Bugs: -

This is Linux specific module and requires /dev/kmsg device with structured kernel logs. +

This module can't be used together with imklog module. When using one of them, make sure the other +one is not enabled.

+

This is Linux specific module and requires /dev/kmsg device with structured kernel logs.

Sample:

The following sample pulls messages from the /dev/kmsg log device. All parameters are left by default, which is usually a good idea. Please -- cgit v1.2.3 From 00edf1573fc240a78e2516b0945ce41167c5977d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 8 Nov 2012 17:41:10 +0100 Subject: bugfixes in string-type template()S Both are closely related and thus rolled into a single commit. - bugfix: improper handling of backslash in string-type template()s - bugfix: leading quote (") in string-type template() lead to thight loop on startup --- ChangeLog | 3 +++ template.c | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4862959..989a0c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ Version 7.2.2 [v7-stable] 2012-10-?? - bugfix: potential abort of imtcp on rsyslogd shutdown - bugfix: imzmq3 segfault with PULL subscription Thanks to Martin Nilsson for the patch. +- bugfix: improper handling of backslash in string-type template()s +- bugfix: leading quote (") in string-type template() lead to thight loop + on startup ---------------------------------------------------------------------------- Version 7.2.1 [v7-stable] 2012-10-29 - bugfix: ruleset()-object did only support a single statement diff --git a/template.c b/template.c index 2fc85e55..e8b95da3 100644 --- a/template.c +++ b/template.c @@ -547,9 +547,14 @@ tplConstruct(rsconf_t *conf) /* helper to tplAddLine. Parses a constant and generates * the necessary structure. + * Paramter "bDoEscapes" is to support legacy vs. v6+ config system. In + * legacy, we must do escapes ourselves, whereas v6+ passes in already + * escaped strings (which we are NOT permitted to further escape, this would + * cause invalid result strings!). Note: if escapes are not permitted, + * quotes (") are just a regular character and do NOT terminate the constant! * returns: 0 - ok, 1 - failure */ -static int do_Constant(unsigned char **pp, struct template *pTpl) +static int do_Constant(unsigned char **pp, struct template *pTpl, int bDoEscapes) { register unsigned char *p; cstr_t *pStrB; @@ -567,8 +572,8 @@ static int do_Constant(unsigned char **pp, struct template *pTpl) /* process the message and expand escapes * (additional escapes can be added here if needed) */ - while(*p && *p != '%' && *p != '\"') { - if(*p == '\\') { + while(*p && *p != '%' && !(bDoEscapes && *p == '\"')) { + if(bDoEscapes && *p == '\\') { switch(*++p) { case '\0': /* the best we can do - it's invalid anyhow... */ @@ -1233,7 +1238,7 @@ struct template *tplAddLine(rsconf_t *conf, char* pName, uchar** ppRestOfConfLin do_Parameter(&p, pTpl); break; default: /* constant */ - do_Constant(&p, pTpl); + do_Constant(&p, pTpl, 1); break; } if(*p == '"') {/* end of template string? */ @@ -1813,7 +1818,7 @@ tplProcessCnf(struct cnfobj *o) do_Parameter(&p, pTpl); break; default: /* constant */ - do_Constant(&p, pTpl); + do_Constant(&p, pTpl, 0); break; } } -- cgit v1.2.3 From b05d4a6db4cc7a0e7a8f4efdb30c784f51b15f2e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 8 Nov 2012 18:02:23 +0100 Subject: bugfix: no error msg on invalid field option in legacy/string template --- ChangeLog | 1 + template.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b3ca5a0..bccb6395 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ Version 6.6.1 [v6-stable] 2012-10-?? - fix API "glitch" in some plugins This did not affect users, but could have caused trouble in the future for developers. +- bugfix: no error msg on invalid field option in legacy/string template --------------------------------------------------------------------------- Version 6.6.0 [v6-stable] 2012-10-22 This starts a new stable branch, based on the 6.5.x series, plus: diff --git a/template.c b/template.c index f62e8453..68c4f539 100644 --- a/template.c +++ b/template.c @@ -666,7 +666,8 @@ static void doOptions(unsigned char **pp, struct templateEntry *pTpe) } else if(!strcmp((char*)Buf, "mandatory-field")) { pTpe->data.field.options.bMandatory = 1; } else { - dbgprintf("Invalid field option '%s' specified - ignored.\n", Buf); + errmsg.LogError(0, NO_ERRCODE, "template error: invalid field option '%s' " + "specified - ignored", Buf); } } -- cgit v1.2.3 From 016253b18d667aea2867b5bb26d0235215c83d43 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 8 Nov 2012 18:02:56 +0100 Subject: doc: mention imported patch in ChangeLog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2bbfa379..665a2324 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Version 7.2.2 [v7-stable] 2012-10-?? - bugfix: improper handling of backslash in string-type template()s - bugfix: leading quote (") in string-type template() lead to thight loop on startup +- bugfix: no error msg on invalid field option in legacy/string template ---------------------------------------------------------------------------- Version 7.2.1 [v7-stable] 2012-10-29 - bugfix: ruleset()-object did only support a single statement -- cgit v1.2.3