Skip to content

Commit

Permalink
add haproxy JSON log-format
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Jan 24, 2025
1 parent 39cc1b3 commit 84ebf69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions defaults/main/1_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ defaults_haproxy:
DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
ssl-default-bind-ciphersuites: 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256'
ssl-default-bind-options: 'ssl-min-ver TLSv1.2 no-tls-tickets'
setenv:
HTTPLOG_JSON: '%{+json}o %(client_ip)ci %(client_port)cp %(request_date)tr %(fe_name_transport)ft %(be_name)b

Check failure on line 60 in defaults/main/1_main.yml

View workflow job for this annotation

GitHub Actions / build

60:116 [trailing-spaces] trailing spaces
%(server_name)s %(time_request)TR %(time_wait)Tw %(time_connect)Tc %(time_response)Tr/%(time_active)Ta

Check failure on line 61 in defaults/main/1_main.yml

View workflow job for this annotation

GitHub Actions / build

61:109 [trailing-spaces] trailing spaces
%(status_code)ST %(bytes_read)B %(captured_request_cookie)CC %(captured_response_cookie)CS

Check failure on line 62 in defaults/main/1_main.yml

View workflow job for this annotation

GitHub Actions / build

62:97 [trailing-spaces] trailing spaces
%(termination_state_cookie)tsc %(actconn)ac %(feconn)fc %(beconn)bc %(srv_conn)sc %(retries)rc %(srv_queue)sq

Check failure on line 63 in defaults/main/1_main.yml

View workflow job for this annotation

GitHub Actions / build

63:116 [trailing-spaces] trailing spaces
%(backend_queue)bq %(captured_request_headers)hr %(captured_response_headers)hs %(http_request){+Q}r'
TCPLOG_JSON: '%{+json}o %(client_ip)ci %(client_port)cp %(request_date)t %(fe_name_transport)ft %(be_name)b

Check failure on line 65 in defaults/main/1_main.yml

View workflow job for this annotation

GitHub Actions / build

65:114 [trailing-spaces] trailing spaces
%(server_name)s %(time_wait)Tw %(time_connect)Tc %(time_total)Tt %(bytes_read)B

Check failure on line 66 in defaults/main/1_main.yml

View workflow job for this annotation

GitHub Actions / build

66:86 [trailing-spaces] trailing spaces
%(termination_state)ts %(actconn)ac %(feconn)fc %(beconn)bc %(srv_conn)sc %(retries)rc %(srv_queue)sq

Check failure on line 67 in defaults/main/1_main.yml

View workflow job for this annotation

GitHub Actions / build

67:108 [trailing-spaces] trailing spaces
%(backend_queue)bq %(captured_request_headers)hr %(captured_response_headers)hs'

defaults:
log: 'global'
Expand Down
4 changes: 4 additions & 0 deletions templates/etc/haproxy/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ global

{% for key, value in HAPROXY_CONFIG.global.items() %}
{% if value | default(none, true) is none %}
{% elif value | is_dict %}
{% for value_key, value_entry in value.items() %}
{{ key }} {{ value_key }} "{{ value_entry }}"
{% endfor %}
{% elif value | is_string %}
{{ key }} {{ value }}
{% else %}
Expand Down

0 comments on commit 84ebf69

Please sign in to comment.