Skip to content

Commit beeb995

Browse files
authored
Adjust parsing of 'proto' to allow for "HTTP/2.0" (#619)
In the standard Apache/nginx combined log format http2 request are logged as "HTTP/2.0" (tested with nginx), which "eq" does _not_ catch. This change checks if "proto" _contains_ "HTTP/2" or "HTTP/3".
1 parent ca2065c commit beeb995

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

snmp/http_access_log_combined

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,10 @@ foreach my $log_name ( keys( %{ $config->{access} } ) ) {
573573
} elsif ( $parsed->{proto} eq 'HTTP/1.1' ) {
574574
$new_entry->{'http1_1'}++;
575575
$data->{totals}{'http1_1'}++;
576-
} elsif ( $parsed->{proto} eq 'HTTP/2' ) {
576+
} elsif ( index( $parsed->{proto}, 'HTTP/2' ) != -1 ) {
577577
$new_entry->{'http2'}++;
578578
$data->{totals}{'http2'}++;
579-
} elsif ( $parsed->{proto} eq 'HTTP/3' ) {
579+
} elsif ( index( $parsed->{proto}, 'HTTP/3' ) != -1 ) {
580580
$new_entry->{'http3'}++;
581581
$data->{totals}{'http3'}++;
582582
}

0 commit comments

Comments
 (0)