Reputation: 633
I am trying to count occurrences of "POST" string inside docker logs
I am doing it like that:
docker logs 2c02 | grep "POST" -c
But I am getting not only the count of "POST" but also the full output of docker logs
. Can I somehow ignore docker logs
output?
Upvotes: 0
Views: 146
Reputation: 12528
docker
prints to stderr. In bash you can do:
docker logs 2c02 |& grep "POST" -c
Upvotes: 4