Docker Community Forums

Share and learn in the Docker community.

Docker log format as Json


(Tom Qiang Wu) #1

Hi all,

I have a question on how to output json-file or any other log driver with json format instead of “Json” string.

e.g. docker run ubuntu /bin/sh ‘{“key”:“value”}’ will output the following
{“log”:"{“key”:“value”}\n",“stream”:“stdout”,“time”:“2016-01-28T21:33:00.642966184Z”}

However this won’t work with elasticsearch as the log will be treated as String, is there anyway to make double quote not escaped?