Repository navigation
feat(sources): templates of your own, rules shared as files, "sends no hostname" - #101
Merged
Merged
Conversation
…o hostname" Templates. "Start from" in the rule editor fills the format and the corrections from a template, keeping the rule's name and addresses. Seven come with SyslogStudio (sources.Templates), each for what the reading as received cannot guess: a device that sends no hostname, a camera, the level in the text, JSON behind a syslog header, Windows-1252, an untrustworthy clock, a format of its own. Each is read on a message of its kind in templates_test.go, which also refuses a template that reads it as the reading as received does - why FortiGate has none: its key=value is read already. Their names and hints are in the 8 locales, which the same test checks. Your own. "Save as a template..." keeps a way of reading - the format, a regular expression included, and the corrections, never the devices - under a name of one's own, from the rule editor or from a file import's format. They are offered in both, listed under Settings > Sources to be deleted, and kept in the window's own settings (sourceTemplates), so they are the person's whichever engine the window drives. Sharing. Export... writes the rules and one's templates to a JSON file (format syslogstudio-source-rules, version 1, without ids); Import... reads one, refuses it whole if one rule or template would not be saved (a newer version too), adds the templates, and saves the rules after the others and turned off, since the addresses they name are another network's until someone has looked. "It sends none" (SourceRule.NoHostname): an RFC 3164 message from a device that sends no hostname has the word after its timestamp taken for one. That word goes back to the tag or the text (syslog.RereadWithoutHost) and the hostname is the source address. The import and rule dialogs, like Settings before, no longer squeeze their content to fit: the file's name and sample were cut in the import. The import-format screenshots are regenerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #100, itself on #99. It will be retargeted to
mainonce they are merged.Templates
Start from, at the top of the rule editor, fills in the format and the corrections from a template. The rule keeps its name, its on/off state and its addresses.
Seven templates come with SyslogStudio (
sources.Templates). Each one sets what the reading as received cannot guess:templates_test.gochecks the templates:Your own templates
Save as a template… keeps a way of reading under a name of your own: the format (a regular expression included) and the corrections, never the devices.
sourceTemplates), so they stay the person's whichever engine the window drives. They areAppmethods, notBackendones.Sharing rules
syslogstudio-source-rules, version 1, without ids).Backend, so they reach the engine the window drives. They are added after the existing rules and turned off, because the addresses they name belong to another network until someone has checked them."It sends none"
New correction
SourceRule.NoHostname, offered in the Hostname menu:<14>Oct 27 09:14:02 motion detectedis read as hostmotion.syslog.RereadWithoutHost), and the hostname is the source address.WireReader), are left as they are.Also
import-formatscreenshots are regenerated.Tests
internal/sources:internal/syslog:RereadWithoutHost(words restored, timestamp kept; RFC 5424 and Cisco left alone).main: your own templates are saved without addresses, offered after the built-in ones, replaced by ID and deleted; an unnamed template or one with an invalid pattern is refused.Checked:
go vet(Windows, Linux),staticcheck,go test -race ./...,svelte-check --fail-on-warnings,npm test,npm run build, the docs' links.