We all know that we can search for a string in a log file and show the surroundings lines to the searched string:
grep -AXX -BXX "searched" file.log
Is possible do the same with the docker logs command?
I want to do is that if already know the string i'm searching happened around one hour ago, using "since" with "after" and "before", get only the result and not all the log, for example something like this:
docker logs --since=65m -A20 -B5 "searched string" [ID]
By now i copy all to a file, resulting sometimes a big file, and use a grep:
docker logs --since=65m [ID] >> file.log
grep -AXX -BXX "searched" file.log