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.
1条回答 默认 最新
- dsh102123 2018-10-10 06:59已采纳
You can get some clues with projects like:
sdjournalpackage, with a Journal class following the fields of an actual journal.
See the test class
Or you could directly forward it to an external syslog, as in