Reputation: 3908
I need to collect some stats from my systemd log files, like how many users pass in a certain query string parameter to my service. I know I can view this information in journalctl but I can't figure out how to do so in Go so that I can aggregate the data. I've been looking for a library for this but can't seem to find anything and I can't figure out where the log files are actually stored.
Upvotes: 2
Views: 3200
Reputation: 1324683
You can get some clues with projects like:
ChimeraCoder/journalctl-go
eparis/access-daemon
chrissnell/kube-journald-filter
which uses coreos/go-systemd/
sdjournal
package, with a Journal class following the fields of an actual journal.journal_test.go
.Or you could directly forward it to an external syslog, as in pmorton/journalfwd
.
Upvotes: 4