-
-
Notifications
You must be signed in to change notification settings - Fork 19
feat(roles/apache_httpd): add csv log formats (and tsv equivalents) #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
70acc81
d153d53
978628f
b9674d8
eb9107d
a2087af
745e079
3835f25
4c77898
e9036da
73c0af1
0eafd19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # {{ ansible_managed }} | ||
| # 2021110301 | ||
| # 2026092201 | ||
| {% if item['by_role'] | d() %} | ||
| # Generated by Ansible role: {{ item['by_role'] }} | ||
| {% endif %} | ||
|
|
@@ -10,6 +10,155 @@ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" c | |
|
|
||
| LogFormat "%h %{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" linuxfabrikio | ||
|
|
||
| {# Row 1 of the field tables below looks misaligned here, but lines up in the rendered file. #} | ||
| # csvio, tsvio: based on the linuxfabrikio LogFormat, plus the Cloudflare headers | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. csvio and tsvio put referer and user agent after all three byte counts (
what was the intention / goal of this? which one should we match? or is the deviation intentional? if it is, we need to document why |
||
| # | ||
| # Field Token Name Group | ||
| # | ||
| # 1 {{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }} timestamp Transaction | ||
| # 2 %v vhost Server | ||
| # 3 %a client_ip Client | ||
| # 4 %{c}a peer_ip Client | ||
| # 5 %{X-Forwarded-For}i xff Client | ||
| # 6 %u user Client | ||
| # 7 %r request_line Request | ||
| # 8 %>s status_final Response | ||
| # 9 %b bytes_resp Transfer | ||
| # 10 %I bytes_in Transfer | ||
| # 11 %O bytes_out Transfer | ||
| # 12 %{Referer}i referer Request | ||
| # 13 %{User-Agent}i useragent Request | ||
| # 14 %{CF-RAY}i cf_ray Cloudflare | ||
| # 15 %{CF-Connecting-IP}i cf_connecting_ip Cloudflare | ||
|
|
||
| LogFormat "\ | ||
| \"{{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }}\";\ | ||
| \"%v\";\ | ||
| \"%a\";\"%{c}a\";\"%{X-Forwarded-For}i\";\"%u\";\ | ||
| \"%r\";\ | ||
| \"%>s\";\ | ||
| \"%b\";\"%I\";\"%O\";\ | ||
| \"%{Referer}i\";\"%{User-Agent}i\";\ | ||
| \"%{CF-RAY}i\";\"%{CF-Connecting-IP}i\"\ | ||
| " csvio | ||
|
|
||
| LogFormat "\ | ||
| {{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }}\t\ | ||
| %v\t\ | ||
| %a\t%{c}a\t%{X-Forwarded-For}i\t%u\t\ | ||
| %r\t\ | ||
| %>s\t\ | ||
| %b\t%I\t%O\t\ | ||
| %{Referer}i\t%{User-Agent}i\t\ | ||
| %{CF-RAY}i\t%{CF-Connecting-IP}i\ | ||
| " tsvio | ||
|
|
||
| # csvextensive, tsvextensive: based on the gelf LogFormat in log_config.conf, plus the Cloudflare headers | ||
| # | ||
| # Field Token Name Group | ||
| # | ||
| # 1 {{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }} timestamp Transaction | ||
| # 2 %v vhost Server | ||
| # 3 %a client_ip Client | ||
| # 4 %{c}a peer_ip Client | ||
| # 5 %{X-Forwarded-For}i xff Client | ||
| # 6 %u user Client | ||
| # 7 %r request_line Request | ||
| # 8 %m method Request | ||
| # 9 %U uri Request | ||
| # 10 %q query Request | ||
| # 11 %H protocol Request | ||
| # 12 %{Referer}i referer Request | ||
| # 13 %{User-Agent}i useragent Request | ||
| # 14 %s status_orig Response | ||
| # 15 %>s status_final Response | ||
| # 16 %b bytes_resp Transfer | ||
| # 17 %I bytes_in Transfer | ||
| # 18 %O bytes_out Transfer | ||
| # 19 %D duration_us Transfer | ||
| # 20 %{CF-RAY}i cf_ray Cloudflare | ||
| # 21 %{CF-Connecting-IP}i cf_connecting_ip Cloudflare | ||
|
|
||
| LogFormat "\ | ||
| \"{{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }}\";\ | ||
| \"%v\";\ | ||
| \"%a\";\"%{c}a\";\"%{X-Forwarded-For}i\";\"%u\";\ | ||
| \"%r\";\"%m\";\"%U\";\"%q\";\"%H\";\"%{Referer}i\";\"%{User-Agent}i\";\ | ||
| \"%s\";\"%>s\";\ | ||
| \"%b\";\"%I\";\"%O\";\"%D\";\ | ||
| \"%{CF-RAY}i\";\"%{CF-Connecting-IP}i\"\ | ||
| " csvextensive | ||
|
|
||
| LogFormat "\ | ||
| {{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }}\t\ | ||
| %v\t\ | ||
| %a\t%{c}a\t%{X-Forwarded-For}i\t%u\t\ | ||
| %r\t%m\t%U\t%q\t%H\t%{Referer}i\t%{User-Agent}i\t\ | ||
| %s\t%>s\t\ | ||
| %b\t%I\t%O\t%D\t\ | ||
| %{CF-RAY}i\t%{CF-Connecting-IP}i\ | ||
| " tsvextensive | ||
|
|
||
| # csvsiem, tsvsiem: the most comprehensive LogFormat, meant for a SIEM | ||
| # | ||
| # Field Token Name Group | ||
| # | ||
| # 1 {{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }} timestamp Transaction | ||
| # 2 %{UNIQUE_ID}e unique_id Transaction | ||
| # 3 %L log_id Transaction | ||
| # 4 %v vhost Server | ||
| # 5 %p server_port Server | ||
| # 6 %P pid Server | ||
| # 7 %a client_ip Client | ||
| # 8 %{c}a peer_ip Client | ||
| # 9 %{X-Forwarded-For}i xff Client | ||
| # 10 %u user Client | ||
| # 11 %r request_line Request | ||
| # 12 %m method Request | ||
| # 13 %U uri Request | ||
| # 14 %q query Request | ||
| # 15 %H protocol Request | ||
| # 16 %{Referer}i referer Request | ||
| # 17 %{User-Agent}i useragent Request | ||
| # 18 %s status_orig Response | ||
| # 19 %>s status_final Response | ||
| # 20 %{Content-Type}o content_type Response | ||
| # 21 %b bytes_resp Transfer | ||
| # 22 %I bytes_in Transfer | ||
| # 23 %O bytes_out Transfer | ||
| # 24 %D duration_us Transfer | ||
| # 25 %X conn_status Connection | ||
| # 26 %k keepalive Connection | ||
| # 27 %{SSL_PROTOCOL}x tls_protocol Connection | ||
| # 28 %{SSL_CIPHER}x tls_cipher Connection | ||
| # 29 %{SSL_CIPHER_USEKEYSIZE}x tls_cipher_usekeysize Connection | ||
| # 30 %{SSL_TLS_SNI}x tls_sni Connection | ||
| # 31 %{SSL_SESSION_RESUMED}x tls_session_resumed Connection | ||
| # 32 %{CF-RAY}i cf_ray Cloudflare | ||
| # 33 %{CF-Connecting-IP}i cf_connecting_ip Cloudflare | ||
|
|
||
| LogFormat "\ | ||
| \"{{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }}\";\"%{UNIQUE_ID}e\";\"%L\";\ | ||
| \"%v\";\"%p\";\"%P\";\ | ||
| \"%a\";\"%{c}a\";\"%{X-Forwarded-For}i\";\"%u\";\ | ||
| \"%r\";\"%m\";\"%U\";\"%q\";\"%H\";\"%{Referer}i\";\"%{User-Agent}i\";\ | ||
| \"%s\";\"%>s\";\"%{Content-Type}o\";\ | ||
| \"%b\";\"%I\";\"%O\";\"%D\";\ | ||
| \"%X\";\"%k\";\"%{SSL_PROTOCOL}x\";\"%{SSL_CIPHER}x\";\"%{SSL_CIPHER_USEKEYSIZE}x\";\"%{SSL_TLS_SNI}x\";\"%{SSL_SESSION_RESUMED}x\";\ | ||
| \"%{CF-RAY}i\";\"%{CF-Connecting-IP}i\"\ | ||
| " csvsiem | ||
|
|
||
| LogFormat "\ | ||
| {{ '%{%FT%T}t.%{usec_frac}t%{%z}t' }}\t%{UNIQUE_ID}e\t%L\t\ | ||
| %v\t%p\t%P\t\ | ||
| %a\t%{c}a\t%{X-Forwarded-For}i\t%u\t\ | ||
| %r\t%m\t%U\t%q\t%H\t%{Referer}i\t%{User-Agent}i\t\ | ||
| %s\t%>s\t%{Content-Type}o\t\ | ||
| %b\t%I\t%O\t%D\t\ | ||
| %X\t%k\t%{SSL_PROTOCOL}x\t%{SSL_CIPHER}x\t%{SSL_CIPHER_USEKEYSIZE}x\t%{SSL_TLS_SNI}x\t%{SSL_SESSION_RESUMED}x\t\ | ||
| %{CF-RAY}i\t%{CF-Connecting-IP}i\ | ||
| " tsvsiem | ||
|
|
||
| LogFormat "\n\ | ||
| Bytes\n\ | ||
| Total, incl. request and headers: %S B\n\ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit message should start with
feat(roles/apache_httpd)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll squash it during merge