From: Takuro Ashie Date: Fri, 26 Jul 2019 02:19:11 +0000 (+0900) Subject: match_regex: Accept all data types of meta data X-Git-Tag: collectd-5.11.0~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7924ff92e47a247ef705f1824ca9ceafd70dc49e;p=thirdparty%2Fcollectd.git match_regex: Accept all data types of meta data match_regex currently accepts only string type of meta data, but there is no reason to reject other data types since they can be easily stringified by meta_data_as_string(). Accepting all data type will provide more benefit, for example the following config can distinguish that data is local or remote, the previous match_regex outputs many error logs for this config though: MetaData "network:received" "true" Signed-off-by: Takuro Ashie --- diff --git a/src/match_regex.c b/src/match_regex.c index 99f0709bd..591d42607 100644 --- a/src/match_regex.c +++ b/src/match_regex.c @@ -342,7 +342,7 @@ static int mr_match(const data_set_t __attribute__((unused)) * ds, /* {{{ */ int status; if (vl->meta == NULL) return nomatch_value; - status = meta_data_get_string(vl->meta, e->key, &value); + status = meta_data_as_string(vl->meta, e->key, &value); if (status == (-ENOENT)) /* key is not present */ return nomatch_value; if (status != 0) /* some other problem */