Shell script to filter logfiles for today's date in an Artificial Ignorance-compatible way
filter-other-days is careful to only throw away entries that we're sure aren't from today. This is implemented by using
grep -v on other dates instead of
grep on today's date. The rationale here is that it's better to receive irrelevant information than it is to miss relevant information.
Get the source, either by git clone or unpacked tarball. Change into the directory and run
sudo make install.
make install uses
/usr/local as the prefix by default; you may override this with
make install PREFIX=/your/custom/prefix.
make uninstall also works as you'd expect.
filter-other-days has no arguments besides
--version. It accepts input on stdin only.
filter-other-days computes today's date at startup. If the time rolls over to a new day during execution, this will not be accounted for.
What are the system requirements?
This program is designed to require only a POSIX environment. GNU
seq was required until version 1.1.0, but this has been fixed.
That being said, this program was tested on a GNU userland (though with
/bin/sh), so there may still be dependencies on GNU extensions. If you find any such dependencies, they will be considered bugs. Please file these in the bug tracker.
If you want to run the test suite, you also need Bash and
I'm passing a file but it says "unrecognized option 'filename'".
Unlike many Unix programs,
filter-other-days does not accept files on the commandline. This is because it makes the argument parsing code more complicated and your shell can accomplish the same thing just as well:
$ filter-other-days < filename
Besides, usually you'd want to use
cat on multiple files before piping to
I'm seeing entries from other days!
filter-other-days is intentionally designed to only filter out what it already knows about. This is because it is dangerous to throw away information you don't understand. This point is particularly salient when one is considering implementing an Artificial Ignorance system based on
That being said, it's obviously unideal that
filter-other-days is not doing its job. Please file a bug and be sure to include some sample input and any interesting variations. When in doubt, include more. Your samples will be added to the test suite and additional filtering will be added to make those tests pass.
Affero GPL 3.0 or later
AJ Jordan email@example.com