(plugin) apps::protocols::http - mode collection catch boolean value … (#3749)

This commit is contained in:
qgarnier 2022-06-17 09:38:16 +02:00 committed by GitHub
parent d91bec2ac1
commit d40cf0204f
1 changed files with 28 additions and 1 deletions

View File

@ -445,7 +445,7 @@ sub parse_structure {
$entry->{ $_->{id} } = $value->{ $_->{id} };
} elsif (ref($value) eq 'ARRAY') {
next;
} elsif ($ref eq '') {
} elsif ($ref eq '' || $ref eq 'JSON::PP::Boolean') {
$entry->{ $_->{id} } = $value;
} else {
next;
@ -579,6 +579,29 @@ sub collect_http_sampling {
$self->{http_cache}->write(data => { http_collected_sampling => $self->{http_collected_sampling} });
}
sub display_variables {
my ($self, %options) = @_;
$self->{output}->output_add(long_msg => '======> variables', debug => 1);
foreach my $tbl_name (keys %{$self->{http_collected}->{tables}}) {
my $expr = 'http.tables.' . $tbl_name;
foreach my $instance (keys %{$self->{http_collected}->{tables}->{$tbl_name}}) {
$expr .= ".[$instance]";
foreach my $attr (keys %{$self->{http_collected}->{tables}->{$tbl_name}->{$instance}}) {
$expr .= ".$attr";
$self->{output}->output_add(
long_msg => sprintf(
' %s = %s',
$expr,
$self->{http_collected}->{tables}->{$tbl_name}->{$instance}->{$attr}
),
debug => 1
);
}
}
}
}
sub collect_http {
my ($self, %options) = @_;
@ -601,6 +624,10 @@ sub collect_http {
}
$self->collect_http_sampling();
if ($self->{output}->is_debug()) {
$self->display_variables();
}
}
sub exist_table_name {