'GCP OPS agent transfer nginx log to cloud logging problem
I followed this link steps to configure nginx.conf and the config.yaml of google-cloud-ops-agent. https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/third-party/nginx After finished, I can see the result in cloud logging by using KQL. However, the fields in nginx log couldn't convert to JSON format.
Just like the following:
nginx original access log:
{"requestMethod":"GET","status":"200","remoteIP":"192.168.134.2",.....}
GCP cloud logging show the result after transfer:
JsonPayload :{ message:"{"requestMethod":"GET","status":"200","remoteIP":"192.168.134.2",.....}" }
The result which I expect should be like this in cloud logging:
JsonPayload :{ requestMethod :"GET", status :"200", remoteIP :"192.168.134.2", ... }
So I don't understand what the problem is. Can you help me to give me some tips?
thanks!
[ops config.yaml][1]enter code here
[ngnix log data][2]
[cloud logging current result ][3]
[1]: https://i.stack.imgur.com/aLwm9.png
[2]: https://i.stack.imgur.com/Zj2J4.png
[3]: https://i.stack.imgur.com/uHxBu.png
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
