3 ms·
One of the ways that I do this (assuming you have access to unix utilities) is to do: cat output.log | tr -d '[0-9]' | sort | uniq -c | sort -n This is a fa
by bpchaps 9y ago
One of the ways that I do this (assuming you have access to unix utilities) is to do:
cat output.log | tr -d '[0-9]' | sort | uniq -c | sort -n
This is a fairly useful way of removing relatively useless information such as timestamps and line numbers when you're looking for rare or unique events. The alternative, I think, is to do a bunch of awk or sed magic, which isn't really fun for anybody. It's especially useful in a time crunch when there's an ongoing outage.
- _ZeD_ 9y agoonestly I found really fun to do "a bunch of awk or sed magic"
- bpchaps 9y agoExcept for us weirdos :p
- apotheosis 9y agoIt would be nice if you told us what this command does for you.
- bpchaps 9y agoIt removes numbers from a log file, sorts it, groups and counts unique lines, then sorts numerically by the count of each unique line. But don't take my word for it. Try it yourself!