X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftail.c;h=25cbcd4c1b5188df787e843c60aecb895aad5688;hb=491712ab7dd36eb58fba23942f5edf4b76b50361;hp=8becc05bc4a86cfcdda73195775ed7a1d5bdc76e;hpb=e21d0408e4e4001b8c66bb1ea7d41b890100d0f5;p=collectd.git diff --git a/src/tail.c b/src/tail.c index 8becc05b..25cbcd4c 100644 --- a/src/tail.c +++ b/src/tail.c @@ -30,6 +30,7 @@ * Instance "exim" * * Regex "S=([1-9][0-9]*)" + * ExcludeRegex "U=root.*S=" * DSType "CounterAdd" * Type "ipt_bytes" * Instance "total" @@ -41,6 +42,7 @@ struct ctail_config_match_s { char *regex; + char *excluderegex; int flags; char *type; char *type_instance; @@ -157,6 +159,9 @@ static int ctail_config_add_match (cu_tail_match_t *tm, if (strcasecmp ("Regex", option->key) == 0) status = ctail_config_add_string ("Regex", &cm.regex, option); + else if (strcasecmp ("ExcludeRegex", option->key) == 0) + status = ctail_config_add_string ("ExcludeRegex", &cm.excluderegex, + option); else if (strcasecmp ("DSType", option->key) == 0) status = ctail_config_add_match_dstype (&cm, option); else if (strcasecmp ("Type", option->key) == 0) @@ -201,8 +206,8 @@ static int ctail_config_add_match (cu_tail_match_t *tm, if (status == 0) { - status = tail_match_add_match_simple (tm, cm.regex, cm.flags, - "tail", plugin_instance, cm.type, cm.type_instance); + status = tail_match_add_match_simple (tm, cm.regex, cm.excluderegex, + cm.flags, "tail", plugin_instance, cm.type, cm.type_instance); if (status != 0) { @@ -211,6 +216,7 @@ static int ctail_config_add_match (cu_tail_match_t *tm, } sfree (cm.regex); + sfree (cm.excluderegex); sfree (cm.type); sfree (cm.type_instance);