Skip to main content

Introducing klogripper, a union of dmesg and tail -f

Hello! I have written a small tool klogripper to continuously extract the log from the Kernel's ring buffer, something dmesg does not seem to be able to do. Building klogripper is trivial:

git clone https://github.com/hartwork/klogripper.git
cd klogripper
make

On the implementation: As calls to klogctl(SYSLOG_ACTION_SIZE_UNREAD, ...) always returned 0 here (-1 without root permissions), I use SYSLOG_ACTION_READ_ALL, instead. On each call the resulting content is compared to the previous run, and any possible overlap is cut off. The result is a continuous stream, allowing to follow the log in real time. In case you write patches for it, please feed them back to me. Thanks!