Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
Forked from phobos182/haproxy.conf
Last active June 14, 2023 14:02
Show Gist options
  • Save vpnwall-services/8138c4ea2c1776993e283002ef413785 to your computer and use it in GitHub Desktop.
Save vpnwall-services/8138c4ea2c1776993e283002ef413785 to your computer and use it in GitHub Desktop.
[LogStash Configuration for HAProxy] Logstash configuration for Haproxy #logstash #haproxy
input {
syslog {
type => "haproxy-access"
port => 514
}
}
filter {
grok {
type => "haproxy-access"
patterns_dir => ["/etc/logstash/patterns/"]
pattern => "%{HAPROXYHTTP}"
named_captures_only => true
}
}
output {
statsd {
count => [
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.response_size", "%{bytes_read}"
]
increment => [
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.hits",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.responses.%{http_status_code}"
]
timing => [
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.response_time", "%{time_duration}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.queue_time", "%{time_queue}",
"haproxy.backend.%{backend_name}.connect_time", "%{time_backend_connect}",
"haproxy.backend.%{backend_name}.response_time", "%{time_backend_response}",
"haproxy.backend.%{backend_name}.queue", "%{backend_queue}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.request_time", "%{time_request}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.retries", "%{retries}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.queue", "%{srv_queue}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.active_connections", "%{actconn}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.backend_connections", "%{beconn}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.frontend_connections", "%{feconn}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.server_connections", "%{srvconn}",
"haproxy.%{frontend_name}.%{backend_name}.%{server_name}.response_size", "%{bytes_read}"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment