Skip to content

Instantly share code, notes, and snippets.

View brandond's full-sized avatar

Brad Davidson brandond

View GitHub Profile
@brandond
brandond / squid
Last active September 18, 2019 18:14 — forked from hrchu/gist:0cc5e783387f5453f528
logstash-grok-pattern-squid
# Follows the squid format in default:
# logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
# http://www.squid-cache.org/Doc/config/logformat/
SQUID4 %{NUMBER:timestamp:float}\s+%{NUMBER:response_time:int} %{IPORHOST:src_ip} %{NOTSPACE:squid_request_status}/%{NUMBER:http_status_code:int} %{NUMBER:transfer_size:int} %{NOTSPACE:http_method} (%{URIPROTO:url_scheme}://)?(?<url_host>\S+?)(:%{INT:url_port})?(/%{NOTSPACE:url_path})?\s+%{NOTSPACE:client_identity}\s+%{NOTSPACE:peer_code}/%{NOTSPACE:peerhost}\s+%{NOTSPACE:content_type}