Finding a string in docker logs of container

前端 未结 8 1142
南方客
南方客 2021-01-30 01:21

What is the best way to find a specific string in the logs of a docker container? Let\'s say I want to see all requests, that are made in the \"nginx\" docker image that came fr

8条回答
  •  星月不相逢
    2021-01-30 02:06

    Run following command to extract container name for image nginx -

    docker ps --filter ancestor=nginx
    

    Copy container ID from last command & then extract log path for your container through below command

    grep "127." `docker inspect --format={{.LogPath}} `
    

提交回复
热议问题