100 points · by daenney · 8y ago · 31 comments
While "uno" is, perhaps, "cooler", logcheck [0] has been around for ages and does just this -- go through your log files, weed out all the stuff that you don't care about, and mails you anything else (which, by definition, is all the stuff you do care about).
Logcheck doesn't use "fuzziness" or uniqueness or any intelligence or anything like that -- just regexes -- but I end up with one single mail per day that only takes me a minute or two to sift through.
Additionally, logcheck is open source.
[0]: http://logcheck.org
└─$ git clone git://git.debian.org/git/logcheck/logcheck.git
Cloning into 'logcheck'...
fatal: unable to connect to git.debian.org:
moszumanska.debian.org[0: 5.153.231.21]: errno=No route to host
moszumanska.debian.org[1: 2001:41c8:1000:21::21:21]: errno=Network is unreachable
Also none of their mailing lists seem to exist anymore: http://logcheck.org/lists.htmlI haven't used logcheck, but I assume you can add your own regexes, but looks like you have something to start with.
[0]: https://salsa.debian.org/debian/logcheck/tree/master/rulefil...
E.g.,
syslog(LOG_WARN, "this thing %s didn't go well", thing);
should log something like this, using JSON just for this example to show the actual structure: [<timestamp>,"<hostname>",<pid>,"<ident>","<facility>",<priority>,"this thing %s didn't go well", "<thing>"]
This would make it much easier to recognize structure in log messages and extract details (syslog(3) format string arguments).Granted, this would have to have happened 20 years ago for it to be widely available now, but still, gotta start somewhere.
We're doing so at work (using rsyslog forwarding as a transport for logs and metrics), and are very happy with what we have.
https://blapid.github.io/cpp/2017/10/31/llcpp-a-quest-for-fa...
Although that writes binary, not JSON.
Apparently knowing how to use things like grep and awk aren't cool nowadays though. Too many people who grew up on windows. I attempted to install centos earlier, after 18 years of dealing with debian-installer, it amazed me how backwards the installer was. All about the clickity-click.
So, i did all that and downloaded the tool and run that command and found out that the feature is "experimental" and not included in the binaries. It's a bit strange: the tool got my attention, and i was ready to experiment, but i couldn't.
If the reason is that it's a paid or saas only feature, that's totally fine but i think authors should make it a bit more obvious from the web page. Otherwise, i'd suggest to put "experimental" binaries there, too.
(Note: the preloading feature is experimental and not included in the public version)
Right under the download links.The feature is called "baseline" everywhere in the text, not "preloading feature", and that's why i got confused.
For example, "As expected, when I start uno with the baseline and don’t do anything with my laptop, it is almost silent since everything that comes in has been seen before."
l = readline() print l while True: n = readline() if editdistance(n, l) > 30%: print n l = n
The simple tool doesn't appear to handle interleaving? Normally uniq handles that by sorting first, but this would need an edit distance aware sort first. I suppose that wouldn't be that hard to build either.
Perhaps it could be just handled with a short window in the tool.
Some of our log lines contain large json blobs that uno only ignores when I set the difference ratio >50%. Maybe you could add some sort of json detection and parsing identify and ignore similar JSON? Seems tricky but just an idea. Also, the go routine seems to panic on the linux and mac binaries when I run "uno --help".
Tools are needed that turn log analysis into more science than art. We currently use the ELK stack to analyze our logs and it works pretty well but still feels like spelunking.
Do any of you HNers have any logging tools you'd recommend?
[1] http://lnav.org/
That’s what Homebrew would do if there was a package anyway.
For a similar tool, I recommend GoAccess [2] and LNAV [3].
[1] https://s3-eu-west-1.amazonaws.com/unomaly/releases/uno_mac/...
[2] brew install goaccess — https://goaccess.io/
[3] brew install lnav — http://lnav.org/
Looking forward to the FOSS release.