Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Filter for ! not working #32

Open
david-drake opened this issue Jul 6, 2017 · 1 comment
Open

Filter for ! not working #32

david-drake opened this issue Jul 6, 2017 · 1 comment

Comments

@david-drake
Copy link

I am trying to filter out any connection that contains action=accept... basically I don't want to pull any logs that are accepted.

When I change the filter to "action!=accept", it still pulls all actions including accept. The only way I've been able to get this working (slightly) is to specify "action=deny,drop,prevent"

Anybody else have this issue?

@adepasquale
Copy link
Contributor

Not sure, this is the relevant code section:

/*
* split filter string in arguments separated by ";"
*/
filterargument = strtok (filterstring, ";");
while (filterargument != NULL)
{
/*
* split argument into name and value separated by "="
*/
argumentvalue = strchr (filterargument, '=');
if (argumentvalue == NULL)
{
fprintf (stderr, "ERROR: syntax error in rule argument '%s'.\n"
" Required syntax: 'argument=value'\n",
filterargument);
return NULL;
}
argumentvalue++;
argumentname = filterargument;
argumentname[argumentvalue - filterargument - 1] = '\0';
argumentvalue = string_trim (argumentvalue, ' ');
argumentname = string_trim (argumentname, ' ');
filterargument = strtok (NULL, ";");
val_arr = NULL;
if (argumentname[strlen (argumentname) - 1] == '!')
{
negation = 1;
argumentname = string_trim (argumentname, '!');
}
else
{
negation = 0;
}

negation variable is conditionally set based on the presence of = or !=.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants