diff --git a/src/tail.c b/src/tail.c
index 01bf6292ac2d1583796d42d387a69b4080d6752f..25cbcd4c1b5188df787e843c60aecb895aad5688 100644 (file)
--- a/src/tail.c
+++ b/src/tail.c
* Instance "exim"
* <Match>
* Regex "S=([1-9][0-9]*)"
+ * ExcludeRegex "U=root.*S="
* DSType "CounterAdd"
* Type "ipt_bytes"
* Instance "total"
struct ctail_config_match_s
{
char *regex;
+ char *excluderegex;
int flags;
char *type;
char *type_instance;
else
cm->flags = 0;
}
+ else if (strncasecmp ("Derive", ci->values[0].value.string, strlen ("Derive")) == 0)
+ {
+ cm->flags = UTILS_MATCH_DS_TYPE_DERIVE;
+ if (strcasecmp ("DeriveSet", ci->values[0].value.string) == 0)
+ cm->flags |= UTILS_MATCH_CF_DERIVE_SET;
+ else if (strcasecmp ("DeriveAdd", ci->values[0].value.string) == 0)
+ cm->flags |= UTILS_MATCH_CF_DERIVE_ADD;
+ else if (strcasecmp ("DeriveInc", ci->values[0].value.string) == 0)
+ cm->flags |= UTILS_MATCH_CF_DERIVE_INC;
+ else
+ cm->flags = 0;
+ }
+ else if (strncasecmp ("Absolute", ci->values[0].value.string, strlen ("Absolute")) == 0)
+ {
+ cm->flags = UTILS_MATCH_DS_TYPE_ABSOLUTE;
+ if (strcasecmp ("AbsoluteSet", ci->values[0].value.string) == 0)
+ cm->flags |= UTILS_MATCH_CF_ABSOLUTE_SET;
+ else
+ cm->flags = 0;
+ }
else
{
cm->flags = 0;
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)
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)
{
}
sfree (cm.regex);
+ sfree (cm.excluderegex);
sfree (cm.type);
sfree (cm.type_instance);
static int ctail_read (void)
{
int success = 0;
- int i;
+ size_t i;
for (i = 0; i < tail_match_list_num; i++)
{
status = tail_match_read (tail_match_list[i]);
if (status != 0)
{
- ERROR ("tail plugin: tail_match_read[%i] failed.", i);
+ ERROR ("tail plugin: tail_match_read[%zu] failed.", i);
}
else
{
static int ctail_shutdown (void)
{
- int i;
+ size_t i;
for (i = 0; i < tail_match_list_num; i++)
{