Skip to content

Instantly share code, notes, and snippets.

@brandond
Forked from hrchu/gist:0cc5e783387f5453f528
Last active September 18, 2019 18:14
Show Gist options
  • Save brandond/e8d15ab6c515b89f41fdf258836a1137 to your computer and use it in GitHub Desktop.
Save brandond/e8d15ab6c515b89f41fdf258836a1137 to your computer and use it in GitHub Desktop.
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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment