From dbec7823b1efcbcc350cad221b6e0fd1dce74994 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Wed, 12 Jun 2019 14:56:43 +0200 Subject: [PATCH] fix influxdb query mode --- database/influxdb/custom/api.pm | 2 +- database/influxdb/mode/query.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/influxdb/custom/api.pm b/database/influxdb/custom/api.pm index 73a422dbc..7ff97275c 100644 --- a/database/influxdb/custom/api.pm +++ b/database/influxdb/custom/api.pm @@ -179,7 +179,7 @@ sub query { $self->{output}->add_option_msg(short_msg => "API returns error '" . $results->{results}[0]->{error} . "'"); $self->{output}->option_exit(); } - push @{$data}, @{$results->{results}[0]->{series}}; + push @{$data}, @{$results->{results}[0]->{series}} if (defined($results->{results}[0]->{series})); } return $data; diff --git a/database/influxdb/mode/query.pm b/database/influxdb/mode/query.pm index 68fff198d..0ea3379c7 100644 --- a/database/influxdb/mode/query.pm +++ b/database/influxdb/mode/query.pm @@ -125,7 +125,7 @@ sub check_options { $self->{custom_keys} = []; $self->{queries} = {}; foreach my $query (@{$self->{option_results}->{query}}) { - next if ($query !~ /^(.*),(.*)/); + next if ($query !~ /^(.*?),(.*)$/); $self->{queries}->{$1} = $2; push @{$self->{maps_counters}->{queries_results}[0]->{set}->{key_values}}, { name => $1 }; push @{$self->{custom_keys}}, $1;