google-cloud-platformstackdrivergoogle-cloud-logging

Google Cloud Logging doesn't parse JSON message from Container Optimized OS


I'm running a Container Optimized OS container on GCE with Cloud Logging wired up. The service is installed correctly and I'm getting logs, however the structured logs aren't parsed:

enter image description here

How can I get Cloud Logging to parse the log entry correctly?


Solution

  • For anyone that runs into this issue, it appears the problem has to do with the timestamp format in the time field of the JSON. In particular, RFC3399 timestamps are not accepted. Use ISO 8601 timestamps instead.

    This seems to contradict the documentation but a Googler friend of mine confirmed this internally and switching to ISO 8601 timestamps did fix the issue for me.