Created
September 24, 2025 12:50
-
-
Save identw/24ed125095585105eb3a2a2a2d2acb91 to your computer and use it in GitHub Desktop.
flient-bit configs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function cb(tag, timestamp, record) | |
| new_record = record | |
| -- for nginx ingress access log | |
| if record["kubernetes"]["labels"]["app.kubernetes.io/name"] == "ingress-nginx" and record["stream"] == "stdout" then | |
| new_record["tag"] = "kube_nginx_ingress_stdout" | |
| return 2, timestamp, new_record | |
| end | |
| if record["log"] == nil then | |
| new_record["log"] = " " | |
| end | |
| -- for other logs | |
| if record["log"] ~= nil and record["log"]["REQUEST_ID"] ~= nil then | |
| new_record["request_id"] = record["log"]["REQUEST_ID"] | |
| new_record["log"]["REQUEST_ID"] = nil | |
| else | |
| new_record["request_id"] = "" | |
| end | |
| new_record["app_namespace"] = record["kubernetes"]["namespace_name"] | |
| return 2, timestamp, new_record | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment