Improved diagnostics in filters
This commit is contained in:
@ -170,30 +170,33 @@ int i;
|
|||||||
my_instance->source = NULL;
|
my_instance->source = NULL;
|
||||||
my_instance->match = NULL;
|
my_instance->match = NULL;
|
||||||
my_instance->nomatch = NULL;
|
my_instance->nomatch = NULL;
|
||||||
for (i = 0; params[i]; i++)
|
if (params)
|
||||||
{
|
{
|
||||||
if (!strcmp(params[i]->name, "match"))
|
for (i = 0; params[i]; i++)
|
||||||
{
|
{
|
||||||
my_instance->match = strdup(params[i]->value);
|
if (!strcmp(params[i]->name, "match"))
|
||||||
}
|
{
|
||||||
else if (!strcmp(params[i]->name, "exclude"))
|
my_instance->match = strdup(params[i]->value);
|
||||||
{
|
}
|
||||||
my_instance->nomatch = strdup(params[i]->value);
|
else if (!strcmp(params[i]->name, "exclude"))
|
||||||
}
|
{
|
||||||
else if (!strcmp(params[i]->name, "source"))
|
my_instance->nomatch = strdup(params[i]->value);
|
||||||
my_instance->source = strdup(params[i]->value);
|
}
|
||||||
else if (!strcmp(params[i]->name, "filebase"))
|
else if (!strcmp(params[i]->name, "source"))
|
||||||
{
|
my_instance->source = strdup(params[i]->value);
|
||||||
if (my_instance->filebase)
|
else if (!strcmp(params[i]->name, "filebase"))
|
||||||
free(my_instance->filebase);
|
{
|
||||||
my_instance->source = strdup(params[i]->value);
|
if (my_instance->filebase)
|
||||||
}
|
free(my_instance->filebase);
|
||||||
else if (!filter_standard_parameter(params[i]->name))
|
my_instance->source = strdup(params[i]->value);
|
||||||
{
|
}
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
else if (!filter_standard_parameter(params[i]->name))
|
||||||
LOGFILE_ERROR,
|
{
|
||||||
"qlafilter: Unexpected parameter '%s'.\n",
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
params[i]->name)));
|
LOGFILE_ERROR,
|
||||||
|
"qlafilter: Unexpected parameter '%s'.\n",
|
||||||
|
params[i]->name)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my_instance->sessions = 0;
|
my_instance->sessions = 0;
|
||||||
|
|||||||
@ -137,7 +137,7 @@ int i, cflags = REG_ICASE;
|
|||||||
my_instance->match = NULL;
|
my_instance->match = NULL;
|
||||||
my_instance->replace = NULL;
|
my_instance->replace = NULL;
|
||||||
|
|
||||||
for (i = 0; params[i]; i++)
|
for (i = 0; params && params[i]; i++)
|
||||||
{
|
{
|
||||||
if (!strcmp(params[i]->name, "match"))
|
if (!strcmp(params[i]->name, "match"))
|
||||||
my_instance->match = strdup(params[i]->value);
|
my_instance->match = strdup(params[i]->value);
|
||||||
@ -152,22 +152,25 @@ int i, cflags = REG_ICASE;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; options[i]; i++)
|
if (options)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(options[i], "ignorecase"))
|
for (i = 0; options[i]; i++)
|
||||||
{
|
{
|
||||||
cflags |= REG_ICASE;
|
if (!strcasecmp(options[i], "ignorecase"))
|
||||||
}
|
{
|
||||||
else if (!strcasecmp(options[i], "case"))
|
cflags |= REG_ICASE;
|
||||||
{
|
}
|
||||||
cflags &= ~REG_ICASE;
|
else if (!strcasecmp(options[i], "case"))
|
||||||
}
|
{
|
||||||
else
|
cflags &= ~REG_ICASE;
|
||||||
{
|
}
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
else
|
||||||
LOGFILE_ERROR,
|
{
|
||||||
"regexfilter: unsupported option '%s'.\n",
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
options[i])));
|
LOGFILE_ERROR,
|
||||||
|
"regexfilter: unsupported option '%s'.\n",
|
||||||
|
options[i])));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -183,7 +183,7 @@ TOPN_INSTANCE *my_instance;
|
|||||||
my_instance->exclude = NULL;
|
my_instance->exclude = NULL;
|
||||||
my_instance->source = NULL;
|
my_instance->source = NULL;
|
||||||
my_instance->filebase = strdup("top");
|
my_instance->filebase = strdup("top");
|
||||||
for (i = 0; params[i]; i++)
|
for (i = 0; params && params[i]; i++)
|
||||||
{
|
{
|
||||||
if (!strcmp(params[i]->name, "count"))
|
if (!strcmp(params[i]->name, "count"))
|
||||||
my_instance->topN = atoi(params[i]->value);
|
my_instance->topN = atoi(params[i]->value);
|
||||||
@ -210,6 +210,12 @@ TOPN_INSTANCE *my_instance;
|
|||||||
params[i]->name)));
|
params[i]->name)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (options)
|
||||||
|
{
|
||||||
|
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
||||||
|
"topfilter: Options are not supported by this "
|
||||||
|
" filter. They will be ignored\n")));
|
||||||
|
}
|
||||||
my_instance->sessions = 0;
|
my_instance->sessions = 0;
|
||||||
if (my_instance->match &&
|
if (my_instance->match &&
|
||||||
regcomp(&my_instance->re, my_instance->match, REG_ICASE))
|
regcomp(&my_instance->re, my_instance->match, REG_ICASE))
|
||||||
|
|||||||
Reference in New Issue
Block a user