[systemd-devel] Accessing journal entries

Lennart Poettering lennart at poettering.net
Fri May 16 10:48:43 PDT 2014


On Mon, 28.04.14 10:03, Rupak Ganguly (rupakg at gmail.com) wrote:

> I am trying to access the journal using the HTTP interface, as described
> here:
> http://www.freedesktop.org/software/systemd/man/systemd-journal-gatewayd.service.html
> 
> I want to filter journal entries by starting date/time or until a specific
> date/time and by number of lines. These are similar to journalctl's
> --since, --until and -n switches.
> 
> The question was, can it done by the HTTP API exposed by journal ?

Yes you can. Consider checking browse.html (as available from the HTTP
server, and also found in src/journal/browse.html), which will tell you
how to put together the Range: HTTP field for this. Basically you just
have to specifiy the journal "cursor" where to start from, plus the
number of entries, separated by ":".

A journal "cursor" identifies each message and is dumped as part of the
verbose message output.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list