Last active
August 13, 2019 02:06
-
-
Save gregwym/010709ca2ca560557c3dad08b137290b to your computer and use it in GitHub Desktop.
Aliyun logtail config for both stdout and stderr K8s Ingress Logs
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
{ | |
"inputs": [ | |
{ | |
"detail": { | |
"IncludeLabel": { | |
"io.kubernetes.container.name": "nginx-ingress-controller" | |
}, | |
"Stderr": true, | |
"Stdout": true | |
}, | |
"type": "service_docker_stdout" | |
} | |
], | |
"processors": [ | |
{ | |
"detail": { | |
"KeepSource": true, | |
"NoMatchError": true, | |
"Keys": [ | |
"client_ip", | |
"x_forward_for", | |
"remote_user", | |
"time", | |
"method", | |
"url", | |
"version", | |
"status", | |
"body_bytes_sent", | |
"http_referer", | |
"http_user_agent", | |
"request_length", | |
"request_time", | |
"proxy_upstream_name", | |
"upstream_addr", | |
"upstream_response_length", | |
"upstream_response_time", | |
"upstream_status", | |
"req_id", | |
"host", | |
"time", | |
"level", | |
"cid", | |
"message", | |
"client_ip", | |
"server", | |
"method", | |
"url", | |
"version", | |
"upstream_addr", | |
"host", | |
"message" | |
], | |
"NoKeyError": true, | |
"Regex": "(?:^(\\S+)\\s-\\s\\[([^\\]]+)\\]\\s-\\s(\\S+)\\s\\[(\\S+)\\s\\S+\\s\"(\\w+)\\s(\\S+)\\s([^\"]+)\"\\s(\\d+)\\s(\\d+)\\s\"([^\"]*)\"\\s\"([^\"]*)\"\\s(\\S+)\\s(\\S+)+\\s\\[([^\\]]*)\\]\\s(\\S+)\\s(\\S+)\\s(\\S+)\\s(\\S+)\\s(\\S+)[^\\n]*(\\S*).*)|(?:^(\\S+\\s\\S+)\\s\\[([^\\]]+)\\]\\s\\S+\\s(?:\\*(\\S+)\\s)?([^,]+),\\sclient:\\s([^,]+),\\sserver:\\s([^,]+),\\srequest:\\s\"(\\S+)\\s(\\S+)\\s([^\\\"]+)\",\\s(?:upstream:\\s\"([^\\\"]+)\",\\s)?host:\\s\"([^\\\"]+)\"$)|(^[^\\n]+$)", | |
"SourceKey": "content" | |
}, | |
"type": "processor_regex" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment