From d3a4a623fa6e429bfa5938e01c97cb7dbd3ece97 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Tue, 28 Oct 2008 23:43:50 +0000 Subject: added optional 2nd argument for "queryarg" parameter that is the list of seperators --- utility/logparse.c | 9 ++++++--- utility/mod_log_sql.conf | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'utility') 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, if (query_beg) { char *key; char *value; + const char *delim = "&"; char *query_string; char *strtok_state; char *query_end = strrchr(++query_beg,' '); @@ -124,8 +125,10 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg, query_string = apr_pstrndup(p, query_beg, query_end-query_beg); logging_log(cfg, LOGLEVEL_DEBUG, "QUERY: Found String %pp, %pp, %s", query_beg, query_end, query_string); - - key = apr_strtok(query_string, "&", &strtok_state); + if (field->args[1]) { + delim = field->args[1]; + } + key = apr_strtok(query_string, delim, &strtok_state); while (key) { value = strchr(key, '='); if (value) { @@ -142,7 +145,7 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg, logging_log(cfg, LOGLEVEL_DEBUG, "QUERY: Found arg: %s = %s", key, value); - key = apr_strtok(NULL, "&", &strtok_state); + key = apr_strtok(NULL, delim, &strtok_state); } } 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 OutputField referer varchar(255) "" referer OutputField machine_id varchar(25) "" "" machineid #VIZU Fields -OutputField poll_id int 0 request queryarg n +OutputField poll_id int 0 request queryarg n "&;" -- cgit