Score:0

How to differentiate docker containers in stackdriver logging?

us flag

I have a VM in GCE with docker installed. There I run containers using the Google Cloud Logging driver. I can see the logs in stackdrive logging. However, i can't easily browse between logs of different containers. All the containers' logs get indexed under the logName projects/my-project/logs/gcplogs-docker-driver

Is there any way to have fields on the "Log Fields" pane on the left that would allow me to easily filter by container? It seems that the logName in the gcplogs-docker-driver is hardcoded, so that's not possible to modify. I tried to "add field to log fields pane" using jsonPayload.container.name but it looks like any field inside jsonPayload cannot be used in the log fields pane, it shows "Value not present"

enter image description here

I also tried adding labels as gcplogs options but they get sent under the jsonPayload as well so same problem as with the container name

Pit avatar
dz flag
Pit
Have you tried with ```jsonPayload.container.imageName="hello-world"```?
us flag
you mean in the search query? if so, yes, but having to type it is not ideal. i have a lot of containers sometimes with random names. That's why I was trying to find a way to do it with the (left) Log Fields pane, which is populated with the available values
Pit avatar
dz flag
Pit
I have created a [Feature Request](https://issuetracker.google.com/196021630) on your behalf because it may be interesting to add that feature. Please take into account that it's not certain to be feasible and there is not an estimated time of arrival for these types of possible updates.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.