Skip to content
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

style: 💄 make modsec debug logs more readable #112

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion configmap.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ resource "kubernetes_config_map" "fluent-bit-config" {
Merge_Log_Key log_processed
Buffer_Size 5MB

[FILTER]
Name parser
Parser modsec-debug-logs
Match cp-ingress-modsec-debug.*
Key_Name log

[FILTER]
Name lua
Match cp-ingress-modsec-stdout.*
Expand Down Expand Up @@ -186,7 +192,13 @@ resource "kubernetes_config_map" "fluent-bit-config" {
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<log>.*)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z

[PARSER]
# https://rubular.com/r/DjPmoX5HnQMesk
Name modsec-debug-logs
Format regex
Regex ^(?<debug_uid>\[\d+\.\d+\]) (?<uri>\[.*\]) (?<log>.*)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
[PARSER]
Name generic-json
Format json
Expand Down