Tailing a docker image, to grep its output
Docker logs are very handy, it just takes the stout and stderr for you to see, the pickle is when you use docker logs
it will not let you parse the output with grep.. I don't care about 90% of the output, just if it contains this small thing!
I found eventually a pretty good way to handle this:
This command will run docker ps
with a filter on image, to identify what to retrieve the logpath of, then it will use docker inspect
to identify where it stores its json log file.
You can now pipe that tail into a grep to parse the output as you need :)
Member discussion