Created
February 2, 2026 12:05
-
-
Save hamza-cskn/60231340d4efc946bd201f447efc96c9 to your computer and use it in GitHub Desktop.
Docker logs but only important ones. No fuzzy/exact duplicates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker logs containername | grep -ie error | sed 's/^[^ ]* //' | awk '!seen[$0]++' | awk ' | |
| function sim(a,b, i,c) { | |
| if (length(a)!=length(b)) return 0 | |
| c=0 | |
| for (i=1;i<=length(a);i++) | |
| if (substr(a,i,1)==substr(b,i,1)) c++ | |
| return c/length(a) | |
| } | |
| { | |
| for (i in buf) | |
| if (sim($0, buf[i]) > 0.99) next | |
| buf[++n]=$0 | |
| if (n>50) delete buf[n-50] | |
| }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment