summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2008-10-28 23:43:50 +0000
committerGravatar Edward Rudd 2008-10-28 23:43:50 +0000
commitd3a4a623fa6e429bfa5938e01c97cb7dbd3ece97 (patch)
treee572ba163687da9957d234317866a579e419cb0a
parenta6ebd05abf74aa4b860141c1728ab4364dbc6c01 (diff)
added optional 2nd argument for "queryarg" parameter that is the list of seperators
-rw-r--r--utility/logparse.c9
-rw-r--r--utility/mod_log_sql.conf2
2 files changed, 7 insertions, 4 deletions
diff --git a/utility/logparse.c b/utility/logparse.c
index 7c52ff6..a1dce69 100644
--- a/utility/logparse.c
+++ b/utility/logparse.c
@@ -117,6 +117,7 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg,
117 if (query_beg) { 117 if (query_beg) {
118 char *key; 118 char *key;
119 char *value; 119 char *value;
120 const char *delim = "&";
120 char *query_string; 121 char *query_string;
121 char *strtok_state; 122 char *strtok_state;
122 char *query_end = strrchr(++query_beg,' '); 123 char *query_end = strrchr(++query_beg,' ');
@@ -124,8 +125,10 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg,
124 query_string = apr_pstrndup(p, query_beg, query_end-query_beg); 125 query_string = apr_pstrndup(p, query_beg, query_end-query_beg);
125 logging_log(cfg, LOGLEVEL_DEBUG, "QUERY: Found String %pp, %pp, %s", 126 logging_log(cfg, LOGLEVEL_DEBUG, "QUERY: Found String %pp, %pp, %s",
126 query_beg, query_end, query_string); 127 query_beg, query_end, query_string);
127 128 if (field->args[1]) {
128 key = apr_strtok(query_string, "&", &strtok_state); 129 delim = field->args[1];
130 }
131 key = apr_strtok(query_string, delim, &strtok_state);
129 while (key) { 132 while (key) {
130 value = strchr(key, '='); 133 value = strchr(key, '=');
131 if (value) { 134 if (value) {
@@ -142,7 +145,7 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg,
142 logging_log(cfg, LOGLEVEL_DEBUG, 145 logging_log(cfg, LOGLEVEL_DEBUG,
143 "QUERY: Found arg: %s = %s", key, value); 146 "QUERY: Found arg: %s = %s", key, value);
144 147
145 key = apr_strtok(NULL, "&", &strtok_state); 148 key = apr_strtok(NULL, delim, &strtok_state);
146 } 149 }
147 } 150 }
148 parser_set_linedata(field->func,query); 151 parser_set_linedata(field->func,query);
diff --git a/utility/mod_log_sql.conf b/utility/mod_log_sql.conf
index de9cd28..f26f113 100644
--- a/utility/mod_log_sql.conf
+++ b/utility/mod_log_sql.conf
@@ -54,5 +54,5 @@ OutputField agent varchar(255) "" agent
54OutputField referer varchar(255) "" referer 54OutputField referer varchar(255) "" referer
55OutputField machine_id varchar(25) "" "" machineid 55OutputField machine_id varchar(25) "" "" machineid
56#VIZU Fields 56#VIZU Fields
57OutputField poll_id int 0 request queryarg n 57OutputField poll_id int 0 request queryarg n "&;"
58 58