diff --git a/contrib/create.sql b/contrib/create.sql index dc26ba7..029ba10 100644 --- a/contrib/create.sql +++ b/contrib/create.sql @@ -55,7 +55,8 @@ CREATE TABLE IF NOT EXISTS "access_logs" ( "production_co2" float DEFAULT NULL, "total_co2" float DEFAULT NULL, "node" varchar DEFAULT NULL, - "asn" integer DEFAULT NULL + "asn" integer DEFAULT NULL, + "http3" varchar(2) DEFAULT NULL ); CREATE INDEX IF NOT EXISTS "index_access_logs_on_host" ON "access_logs" ("host"); diff --git a/src/access_log.cr b/src/access_log.cr index 5d94217..1c972af 100644 --- a/src/access_log.cr +++ b/src/access_log.cr @@ -28,7 +28,7 @@ crawler = false crawlers = [] of Crawler # Fields in database # TODO: Obtain them from AccessLog -fields = %w[id remote_user host msec server_protocol request_method request_completion uri request_uri query_string status sent_http_content_type sent_http_content_encoding sent_http_etag sent_http_last_modified http_accept http_accept_encoding http_accept_language http_pragma http_cache_control http_if_none_match http_dnt http_user_agent http_origin http_referer request_time bytes_sent body_bytes_sent request_length http_connection pipe connection_requests geoip2_data_country_name geoip2_data_city_name ssl_server_name ssl_protocol ssl_early_data ssl_session_reused ssl_curves ssl_ciphers ssl_cipher sent_http_x_xss_protection sent_http_x_frame_options sent_http_x_content_type_options sent_http_strict_transport_security nginx_version pid crawler datacenter_co2 network_co2 consumer_device_co2 production_co2 total_co2 node asn] +fields = %w[id remote_user host msec server_protocol request_method request_completion uri request_uri query_string status sent_http_content_type sent_http_content_encoding sent_http_etag sent_http_last_modified http_accept http_accept_encoding http_accept_language http_pragma http_cache_control http_if_none_match http_dnt http_user_agent http_origin http_referer request_time bytes_sent body_bytes_sent request_length http_connection pipe connection_requests geoip2_data_country_name geoip2_data_city_name ssl_server_name ssl_protocol ssl_early_data ssl_session_reused ssl_curves ssl_ciphers ssl_cipher sent_http_x_xss_protection sent_http_x_frame_options sent_http_x_content_type_options sent_http_strict_transport_security nginx_version pid crawler datacenter_co2 network_co2 consumer_device_co2 production_co2 total_co2 node asn http3] # Params for the query params = [] of String # SWD @@ -220,7 +220,8 @@ DB.open database do |db| (swd ? s.try(&.production_co2) : nil), (swd ? s.try(&.total_co2) : nil), (node ? System.hostname : nil), - a.try(&.id) + a.try(&.id), + access_log.http3 # Ignore parsing errors rescue e : JSON::ParseException diff --git a/src/models/access_log.cr b/src/models/access_log.cr index 3ad4394..99c3afc 100644 --- a/src/models/access_log.cr +++ b/src/models/access_log.cr @@ -59,4 +59,5 @@ class AccessLog property nginx_version : String property pid : String property remote_addr : String? + property http3 : String? end