summaryrefslogtreecommitdiffstats
path: root/plugins/sm_cust_bindcdr
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-04-15 10:01:22 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-04-15 10:01:22 +0200
commitf31e2b3b66b6ed21c96cfe3526c9c8b4aee309ed (patch)
tree84db8a5854b3f7dea0aee4f37b0e864b751e547f /plugins/sm_cust_bindcdr
parent27866eddb99885b6617fde0ee91ea7b1cd4873fb (diff)
downloadrsyslog-f31e2b3b66b6ed21c96cfe3526c9c8b4aee309ed.tar.gz
rsyslog-f31e2b3b66b6ed21c96cfe3526c9c8b4aee309ed.tar.xz
rsyslog-f31e2b3b66b6ed21c96cfe3526c9c8b4aee309ed.zip
sm_cust_bindcdr: updated field mapping according to spec received today
Diffstat (limited to 'plugins/sm_cust_bindcdr')
-rw-r--r--plugins/sm_cust_bindcdr/sm_cust_bindcdr.c14
1 files changed, 11 insertions, 3 deletions
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));