[systemd-devel] [PATCH] journalctl: allow customizable output formats

Daniel P. Berrange berrange at redhat.com
Tue Sep 23 02:36:56 PDT 2014


On Mon, Sep 22, 2014 at 12:43:28PM -0400, Daurnimator wrote:
> On 22 September 2014 11:33, Daniel P. Berrange <berrange at redhat.com> wrote:
> 
> > The current '--output FORMAT' argument defines a number of
> > common output formats, but there are some useful cases it
> > does cover. In particular when reading application logs it
> > is often desirable to display the code file name, line number
> > and function name. Rather than defining yet more fixed output
> > formats, this patch introduces user defined output formats.
> >
> > The format string is an arbitrary string which contains a
> > mixture of literal text and variable subsistitions. Each
> > variable name corresponds to a journal field name. A variable
> > name can be optionally followed by a data type, and in the
> > case of string types, a length limit.
> >
> 
> As an opposing point of view, I've been accomplishing this by piping output
> through a script that parses and displays JSON.
> I rather this style of composability than passing format strings to
> journalctl itself.

Sure you could do that, but it is really madness to expect anyone who
just wants to display a slightly different set of fields to write a
script to parse JSON and re-write it. When I have end users doing
troubleshooting of libvirt for bug reports, I want to be able to just
tell them to run a direct journalctl command to collect data I need,
not have to write or download some extra script to parse JSON.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the systemd-devel mailing list