haproxy_log_analysis
haproxy_log_analysis copied to clipboard
Allow filters per command
Right now one can run a given number of commands after a list of filters have trimmed the complete log file.
This is usually fine, but limits its flexibility, specially given that parsing huge files is really time consuming.
The idea would be that with a single pass through the log file, one could run commands with a different set of filters, i.e. something like:
haproxy_log_analysis -l haproxy.log -p counter,top_ips(status_code[200]),slow_requests_counter(slow_requests[5000],backend[slow])
This above would mean:
- return the count of all valid lines
- return the top 10 IPs from all valid lines that have a status code 200
- return the count of slow requests that were more than 5 seconds slow only on the
slowbackend
Right now, if you want to achieve that you have to call haproxy_log_analysis three times, as filters are applied globally.