summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lang <david@lang.hm>2011-01-25 14:13:14 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-01-25 14:13:14 +0100
commit33e5e60734f654256ac33781728777798bc88d1c (patch)
tree5a9fbe3af511374928f9f0208821f9009d67c1c4
parent64a740a86162b19b3f57bcf221ce49aa6e57523a (diff)
downloadrsyslog-33e5e60734f654256ac33781728777798bc88d1c.tar.gz
rsyslog-33e5e60734f654256ac33781728777798bc88d1c.tar.xz
rsyslog-33e5e60734f654256ac33781728777798bc88d1c.zip
pmciscomsg: fixed some problems
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
-rw-r--r--plugins/pmcisconames/pmcisconames.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/pmcisconames/pmcisconames.c b/plugins/pmcisconames/pmcisconames.c
index 28fe33d0..47d1f6f6 100644
--- a/plugins/pmcisconames/pmcisconames.c
+++ b/plugins/pmcisconames/pmcisconames.c
@@ -41,7 +41,7 @@
#include "unicode-helper.h"
MODULE_TYPE_PARSER
-PARSER_NAME("rsyslog.lastline")
+PARSER_NAME("rsyslog.cisconames")
/* internal structures
*/
@@ -108,9 +108,14 @@ dbgprintf("not a cisco name mangled log!\n");
ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE);
}
/* bump the message portion up by two characters to overwrite the extra : */
- memmove(p2parse, p2parse + 2, lenMsg - 2);
+ lenMsg -=2;
+ memmove(p2parse, p2parse + 2, lenMsg);
+ *(p2parse + lenMsg) = '\n';
+ *(p2parse + lenMsg + 1) = '\0';
+ pMsg->iLenRawMsg -=2;
+ pMsg->iLenMSG -=2;
/* now, claim to abort so that something else can parse the now modified message */
- DBGPRINTF("pmcisconames detected a mangled Cisco log message message\n");
+ DBGPRINTF("pmcisconames: new mesage: [%d]'%s'\n", lenMsg, p2parse);
ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE);
finalize_it:
@@ -143,7 +148,7 @@ CODEmodInit_QueryRegCFSLineHdlr
CHKiRet(objUse(parser, CORE_COMPONENT));
CHKiRet(objUse(datetime, CORE_COMPONENT));
- dbgprintf("lastmsg parser init called, compiled with version %s\n", VERSION);
+ DBGPRINTF("cisconames parser init called, compiled with version %s\n", VERSION);
bParseHOSTNAMEandTAG = glbl.GetParseHOSTNAMEandTAG(); /* cache value, is set only during rsyslogd option processing */