diff --git a/README.md b/README.md index 6c0121b..7bd645b 100644 --- a/README.md +++ b/README.md @@ -109,13 +109,40 @@ all messages with severity above 4 will be discarded. syslogsidecar saves timestamps in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) format -### Configuration folder +## Configuration All configuration files of the process should be stored within one folder. Path of this folder process receives via "--cf" flag in command line, e.g.: ```bash ./syslogproc --cf ./cmd/syslogproc/conf/ ``` + +Any value in configuration file may be [overridden using environment variables](https://github.com/g41797/gonfig#gonfig-) + +### Embedded configuration files + +syslogsidecar process can use embedded configuration files: +```go +import ( + "embed" + ......... +) + +//go:embed conf +var embconf embed.FS + +func main() { + ............................ + ............................ + cleanUp, _ := sidecar.UseEmbeddedConfiguration(&embconf) + defer cleanUp() + sidecar.Start(syslog2nats.NewConnector()) +} + +``` +For this case content of **conf** subfolder embedded within process. +No needs for "--cf" flag in command line. + ### syslog server configuration Configuration of syslog server component of syslogsidecar is saved in the file syslogreceiver.json: @@ -180,7 +207,7 @@ type SyslogConfiguration struct { } ``` -### Experimental feature +## Experimental feature For os with support of **SO_REUSEPORT** socket option, sidecar opens simultaneously 8 UDP ports. You can use netstat command to see the list: ```sh @@ -363,32 +390,6 @@ Additional helper function - *syslogsidecar.AllTargets()*: // and error for absent or wrong syslogconf.json file. func AllTargets() ([]string, error) ``` -## Embedding configuration files - -syslogsidecar process can use embedded configuration files: -```go -import ( - "embed" - ......... -) - -//go:embed conf -var embconf embed.FS - -func main() { - ............................ - ............................ - cleanUp, _ := sidecar.UseEmbeddedConfiguration(&embconf) - defer cleanUp() - sidecar.Start(syslog2nats.NewConnector()) -} - -``` -For this case content of **conf** subfolder embedded within process. -No needs for "--cf" flag in command line. - -Any value in configuration file may be [overridden using environment variables](https://github.com/g41797/gonfig#gonfig-) - ## Implementations are based on syslogsidecar