Report Template: Simple Counters¶
This syslog report template shows how to count syslog messages with specific keywords.
Report Goal¶
We need to count the messages containing Keyword1, Keyword2, etc. separately.
Report Template¶
Initial step: create a new template.
Initialization (Pre Commands)¶
The initialization (Pre) commands create a table for the counters and set them all to zero:
CREATE TABLE Counters (Name TEXT PRIMARY KEY, Value INTEGER);
INSERT INTO Counters (Name, Value) VALUES
('Keyword1', 0),
('Keyword2', 0);
Data Collection (Commands)¶
For each keyword, add a counter increment command:
The command has to be executed for messages that match the filter:
Finalization (Post Commands)¶
Finalizing (Post) commands are not required for this example.
Output Filename¶
A report timestamp creates an unique file name:
Output Directory¶
Leave the target directory blank. Syslog Watcher will prompt you to enter the output directory at a generation time.
Output HTML¶
Here is a simple HTML that displays the counters:
Results¶
You will end up with something like this:
Download Template¶
You can download this report example (simple-counters.report.json) and import it into Syslog Watcher Manager.