X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_tail_match.c;h=8ae2208cc1e2138e9c304930e016d039c7dfb480;hb=9f6f901889d4c9f594b5ae1fd0f449fcdd2d8fe3;hp=34fe2dced95c91fc5a493dc71a724248ceec45a1;hpb=250dc17bfb3c5488b789347f1f570913701d31ca;p=collectd.git diff --git a/src/utils_tail_match.c b/src/utils_tail_match.c index 34fe2dce..8ae2208c 100644 --- a/src/utils_tail_match.c +++ b/src/utils_tail_match.c @@ -80,15 +80,15 @@ static int simple_submit_match (cu_match_t *match, void *user_data) vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, data->plugin, sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, data->plugin_instance, sizeof (vl.plugin_instance)); + sstrncpy (vl.type, data->type, sizeof (vl.type)); sstrncpy (vl.type_instance, data->type_instance, sizeof (vl.type_instance)); - plugin_dispatch_values (data->type, &vl); + plugin_dispatch_values (&vl); if (match_value->ds_type & UTILS_MATCH_DS_TYPE_GAUGE) { @@ -99,10 +99,11 @@ static int simple_submit_match (cu_match_t *match, void *user_data) return (0); } /* int simple_submit_match */ -static int tail_callback (void *data, char *buf, int buflen) +static int tail_callback (void *data, char *buf, + int __attribute__((unused)) buflen) { cu_tail_match_t *obj = (cu_tail_match_t *) data; - int i; + size_t i; for (i = 0; i < obj->matches_num; i++) match_apply (obj->matches[i].match, buf); @@ -134,7 +135,7 @@ cu_tail_match_t *tail_match_create (const char *filename) void tail_match_destroy (cu_tail_match_t *obj) { - int i; + size_t i; if (obj == NULL) return; @@ -190,7 +191,7 @@ int tail_match_add_match (cu_tail_match_t *obj, cu_match_t *match, } /* int tail_match_add_match */ int tail_match_add_match_simple (cu_tail_match_t *obj, - const char *regex, int ds_type, + const char *regex, const char *excluderegex, int ds_type, const char *plugin, const char *plugin_instance, const char *type, const char *type_instance) { @@ -198,7 +199,7 @@ int tail_match_add_match_simple (cu_tail_match_t *obj, cu_tail_match_simple_t *user_data; int status; - match = match_create_simple (regex, ds_type); + match = match_create_simple (regex, excluderegex, ds_type); if (match == NULL) return (-1); @@ -236,7 +237,7 @@ int tail_match_read (cu_tail_match_t *obj) { char buffer[4096]; int status; - int i; + size_t i; status = cu_tail_read (obj->tail, buffer, sizeof (buffer), tail_callback, (void *) obj);