In my cluster in GCP, I have multiple services(all python being served by either gunicorn or hypercorn) that get a http request and log out an entry like this:
::ffff:127.0.0.1:52726 - - [10/Jan/2021:19:56:36 +0000] "GET /health-check 1.1" 200 2 "-" "kube-probe/1.16+" -
I want it to get parsed into this format in stackdriver:
"httpRequest": {
"requestMethod": "GET",
"requestUrl": "/health-check",
"requestSize": "148",
"status": 200,
"responseSize": "2",
"userAgent": "kube-probe/1.16+",
"remoteIp": "::ffff:127.0.0.1:52726",
"serverIp": "127.0.0.1",
"latency": "0.043219s"
}
Besides the log matching what the nginx fluentd plugin is looking for, what else do I need to do to make this happen?
We haven't done anything with the fluentd setup in the cluster, it is just the default that is installed when you create a cluster in GCP.
I have seen people say just create a single line json, which could work, but seems sort of hacky and potentially prone to error if a "
is in any of the fields I am trying to report.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…