Finding a string in docker logs of container

前端 未结 8 1152
南方客
南方客 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:02

    this can happen if the container is logging to stderr, piping works only for stdout, so try:

    docker logs nginx 2>&1 | grep "127."
    

提交回复
热议问题