From 27866eddb99885b6617fde0ee91ea7b1cd4873fb Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 14 Apr 2011 12:30:45 +0200 Subject: bugfix: doc for impstats had wrong config statements also, config statements were named a bit inconsistent, resolved that problem by introducing an alias and only documenting the consistent statements Thanks to Marcin for bringing up this problem. --- plugins/impstats/impstats.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/impstats/impstats.c b/plugins/impstats/impstats.c index aa98ae9d..cfbbad76 100644 --- a/plugins/impstats/impstats.c +++ b/plugins/impstats/impstats.c @@ -212,7 +212,9 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(statsobj, CORE_COMPONENT)); + /* the pstatsinverval is an alias to support a previous screwed-up syntax... */ CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatsinterval", 0, eCmdHdlrInt, NULL, &cs.iStatsInterval, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatinterval", 0, eCmdHdlrInt, NULL, &cs.iStatsInterval, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatfacility", 0, eCmdHdlrInt, NULL, &cs.iFacility, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatseverity", 0, eCmdHdlrInt, NULL, &cs.iSeverity, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); -- cgit From e7deab65dcad38a613c749e44e36c6c795000867 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 14 Apr 2011 12:47:04 +0200 Subject: bugfix: IPv6-address could not be specified in omrelp this was due to improper parsing of ":" closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250 --- plugins/omrelp/omrelp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index d5ef8b4f..4a21627d 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -249,8 +249,18 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) /* extract the host first (we do a trick - we replace the ';' or ':' with a '\0') * now skip to port and then template name. rgerhards 2005-07-06 */ - for(q = p ; *p && *p != ';' && *p != ':' ; ++p) - /* JUST SKIP */; + if(*p == '[') { /* everything is hostname upto ']' */ + ++p; /* skip '[' */ + for(q = p ; *p && *p != ']' ; ++p) + /* JUST SKIP */; + if(*p == ']') { + *p = '\0'; /* trick to obtain hostname (later)! */ + ++p; /* eat it */ + } + } else { /* traditional view of hostname */ + for(q = p ; *p && *p != ';' && *p != ':' && *p != '#' ; ++p) + /* JUST SKIP */; + } pData->port = NULL; if(*p == ':') { /* process port */ -- cgit From f31e2b3b66b6ed21c96cfe3526c9c8b4aee309ed Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Apr 2011 10:01:22 +0200 Subject: sm_cust_bindcdr: updated field mapping according to spec received today --- plugins/sm_cust_bindcdr/sm_cust_bindcdr.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c b/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c index 3fe96ac4..baad667e 100644 --- a/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c +++ b/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c @@ -122,7 +122,8 @@ finalize_it: * An actual message sample for what we intend to parse is (one line): <30>Mar 24 13:01:51 named[6085]: 24-Mar-2011 13:01:51.865 queries: info: client 10.0.0.96#39762: view trusted: query: 8.6.0.9.9.4.1.4.6.1.8.3.mobilecrawler.com IN TXT + (10.0.0.96) */ -#define SQL_STMT "INSERT INTO CDR(`Date`,`Time`, timeMS, client, view, query, ip) VALUES ('" +//previos dev: #define SQL_STMT "INSERT INTO CDR(`Date`,`Time`, timeMS, client, view, query, ip) VALUES ('" +#define SQL_STMT "INSERT INTO CDR(`date`,ip,user,dest) VALUES ('" #define ADD_SQL_DELIM \ memcpy(*ppBuf + iBuf, "', '", sizeof("', '") - 1); \ iBuf += sizeof("', '") - 1; @@ -316,16 +317,21 @@ CODESTARTstrgen memcpy(*ppBuf + iBuf, szDate, lenDate); iBuf += lenDate; - ADD_SQL_DELIM + /* prviously: ADD_SQL_DELIM */ + *(*ppBuf + iBuf) = ' '; + ++iBuf; memcpy(*ppBuf + iBuf, szTime, lenTime); iBuf += lenTime; ADD_SQL_DELIM + /* we shall now discard this part memcpy(*ppBuf + iBuf, szMSec, lenMSec); iBuf += lenMSec; ADD_SQL_DELIM + */ + /* Note that this seem to be the IP to use */ memcpy(*ppBuf + iBuf, szClient, lenClient); iBuf += lenClient; ADD_SQL_DELIM @@ -336,10 +342,12 @@ CODESTARTstrgen memcpy(*ppBuf + iBuf, szQuery, lenQuery); iBuf += lenQuery; - ADD_SQL_DELIM + /* this is now the last field, so we dont need: ADD_SQL_DELIM */ + /* no longer to be included memcpy(*ppBuf + iBuf, szIP, lenIP); iBuf += lenIP; + */ /* end of SQL statement/trailer (NUL is contained in string!) */ memcpy(*ppBuf + iBuf, SQL_STMT_END, sizeof(SQL_STMT_END)); -- cgit