request for peer review on feature 9 - XML
"Jason Pyeron" <[email protected]> Sat, 8 Oct 2022 11:26:32 -0400
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
I pushed, to the xml-from-master branch, 2 commits to support XML formatting [1]. This is a redo and rebasing of the XML feature I have been using. My goals on this patch, besides supporting XML are: * Minimize the introduction of new modules * Gracefully handle services that are not (yet) XML aware * Make the diff as clean / streamlined as possible Previously, I had leveraged XML libraries. These libraries force certain structure and constructs on their usage within the code and would likely cause the service maintainers grief and frustration. I chose syslog-ng as the proof of concept as it was: * Last improved in 2016, so it is stable and not going to interrupt a developer * Middle of the road for output organization / complexity Why XML support? It has nothing to do with HTML - in any way. Every day people like me have hundreds of Logwatch emails in their inbox. These summaries are great, but after a certain quantity they themselves become unreadable. With XML formatting, these reports can very easily be aggregated, filtered, queried, and formatted. This allows me to answer many questions easily. The top question I want to know what systems have not reported in the last 30 hours. My second most important visualization is on disk space data across all systems. The dashboard view makes life much easier. Here is the git log -2 commit 4cc503d9c32abddf84972e4c42ba219e17ca1602 (HEAD -> xml-from-master, sf/xml-from-master) Author: Jason Pyeron <[email protected]> Date: Sat Oct 8 10:00:38 2022 -0400 [syslog-ng] add XML support TODO: prevent empty XML reports by embargoing output until some real output occurs [feature-requests:#9] commit 377722f81e6adeebb44d01d82c9d16346fe2ed3f Author: Jason Pyeron <[email protected]> Date: Sun Oct 2 09:22:27 2022 -0400 [logwatch.pl] Add basic support for XML, services are free to define their own schema. This assumes none of the services are emitting XML when the XML prolog is missing and wraps the output in CDATA. The prolog, e.g. <?xml version="1.0" encoding="UTF-8" ?> must be provided by a service if it is supporting XML. No checks on version are intended at this time, but the output is assumed to be utf8, and check may be made against the encoding listed in the prolog. If a service reports in XML format, no additional processing is made. Care is needed with the ignore.conf, as it can match XML tags and result in non-compliance with a service's schema document. [feature-requests:#9] 1: https://sourceforge.net/p/logwatch/feature-requests/9/ -Jason