Extract recent error-level lines from a container
Build a paste-ready command, then review its compatibility and effects before running it.
docker logs --since <minutes>m --timestamps <container> 2>&1 | rg -i 'error|fatal|panic|exception' | tail -<count>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsdockerdocker must be installed and available on PATH.
Version supportdocker Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals2026-07-23T09:41:22.184Z ERROR request_id=8ad2 upstream timeoutRepresentative successful output; values vary with the selected target and system state.
Known errorsdocker: command not founddocker is missing or is not available on PATH.
Verifydocker logs --since {{minutes}}m --timestamps {{container}} 2>&1 | rg -i 'error|fatal|panic|exception' | tail -{{count}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01dockerCommandRuns the docker stage of this one-liner.
02logsArgumentPasses logs to docker.
03--sinceOptionLimits results to entries after the supplied time.
04<minutes>mParameterA value supplied in the Fill parameters section.
05--timestampsOptionConfigures docker with the --timestamps option.
06<container>ParameterA value supplied in the Fill parameters section.
072>&1RedirectionRedirects command input, standard output, or error output.
08|PipelinePasses the output on the left to the command on the right.
09rgCommandRuns the rg stage of this one-liner.
10-iOptionConfigures rg with the -i option.
11'error|fatal|panic|exception'ArgumentPasses 'error|fatal|panic|exception' to rg.
12|PipelinePasses the output on the left to the command on the right.
13tailCommandRuns the tail stage of this one-liner.
14-<count>OptionConfigures tail with the -<count> option.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
docker logs --since 30m --timestamps api 2>&1 | rg -i 'error|fatal|panic|exception' | tail -20
Example output
2026-07-23T09:41:22.184Z ERROR request_id=8ad2 upstream timeout
2026-07-23T09:43:01.007Z FATAL database connection pool exhausted
Illustrative output — exact values vary by system and data.
Official sources