Discussion:
Journal statistics
(too old to reply)
P.R.Dinesh
2018-02-14 06:42:08 UTC
Permalink
Raw Message
I am interesting in getting some statistics information from journal, for
eg.,
1) number of logs
2) number of logs per severity
3) number of logs per daemon
4) time when log rotate happen
...

Currently I am generating these data using journalctl and wc (journalctl
<Filter> | wc -l)
Is there any other better/native way to get these statistics?

Regards,
Dinesh
Lennart Poettering
2018-02-14 09:50:26 UTC
Permalink
Raw Message
On Mi, 14.02.18 06:42, P.R.Dinesh (***@gmail.com) wrote:

> I am interesting in getting some statistics information from journal, for
> eg.,
> 1) number of logs
> 2) number of logs per severity
> 3) number of logs per daemon

I presume you mean "log records" when you write "logs", right?

Such accounting is currently not available. Please file an RFE issue
about this, or even better a PR implementing this.

> 4) time when log rotate happen

In theory we could add a recognizable log record for this (i.e. one
that can be recognized by its MESSAGE_ID field), but so far we didn't
since it's kind of a feedback loop thing: rotation is supposed to make
room for new log records, but if we generate log output for doing it
then we'll also make it consume space right-away.

That said, we might want to revisit this, hence please file an RFE
issue about this too.

> ...
>
> Currently I am generating these data using journalctl and wc (journalctl
> <Filter> | wc -l)
> Is there any other better/native way to get these statistics?

Currently not, no.

Lennart

--
Lennart Poettering, Red Hat
Loading...