diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2019-02-20 20:21:08 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2019-02-20 20:38:04 -0800 |
commit | e540ab40c0efe6360e9a6e3d9f34b0e1b420fdde (patch) | |
tree | fb4a324225f2b75a185e10aafeb1ac8f166e2cab /src/Makefile.am |
codex: initial commit
!!! This code is a very quick hack I made in an evening of
!!! inspired curiosity, the code should be considered of junk
!!! quality.
Codex aspires to be a read-only FUSE interface to the journal
provided by systemd.
At this point it only implements simple reading of the journal
through a single match filter selected via filesystem path.
With codex mounting the journal @ /mnt, you can see what
fields are available for matching against via:
`ls /mnt/by-field`
This returns a list of fields as directories, which you can then
list the contents of to see all the unique values present for the
repsective field, returned as regular files:
`ls /mnt/by-field/UNIT`
Then by reading one of the returned files, you read the contents
of the journal filtered on the respective field and value, e.g.:
`cat /mnt/by-field/UNIT/apt-daily.timer`
and you'll get a stream of all the data in the journal with a
filter of UNIT=apt-daily.timer
With some work, this could be made more advanced supporting
combined filters, perhaps in the form of:
`cat /mnt/by-field/UNIT/apt-daily.timer/and/by-field/PRIORITY/3/all`
As-is, the path by-field/UNIT/apt-daily.timer is a regular file,
so no such constructions are possible. But if it were changed to
be another directory, where you can select further matches by
traversing yet another and/by-field subpath, where all the fields
are available (or maybe only the matching subset of fields if
feasible), then more complex uses could be satisfied. Imagine
or/by-field and and/by-field being available under every value's
directory.
Note this commit includes a barely functioning PoC. It is not
intended for production, but you can already use it to navigate
journals in a way I find more pleasant than journalctl.
I think it'd be great to have a tool like this built out with all
the bells and whistles. It may make sense to roll something
similar into journalctl like `journalctl --mount /mnt/point`.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r-- | src/Makefile.am | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..29477df --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,2 @@ +bin_PROGRAMS = codex +codex_SOURCES = codex.c |