Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Last active November 16, 2020 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haproxytechblog/31dbe3cd0ba98e604213603c27204256 to your computer and use it in GitHub Desktop.
Save haproxytechblog/31dbe3cd0ba98e604213603c27204256 to your computer and use it in GitHub Desktop.
HAProxy Log Sampling
global
log 127.0.0.1:514 sample 1:10 local0 info
log 127.0.0.1:514 sample 1:1 local0 info
log 127.0.0.1:514 sample 1:2 local0 info
# Local Syslog:
log 127.0.0.1:514 sample 1:1 local0 info
# Another Syslog:
log 192.168.1.100:514 sample 1:2 local0 info
# Sampled logs:
log 192.168.1.100:514 sample 1:10 local0 info
# Error logs:
log 192.168.1.101:514 local0 err
frontend www
bind :80
acl failed_request status 400 401 403 404 405 408 429 500 503
http-response set-log-level err if failed_request
log 127.0.0.1:514 sample 2-3,8-11,46,67-83:100 local0 info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment