Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
g41797 committed Nov 10, 2023
1 parent 91dfcc9 commit bc275ae
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit bc275ae

Please sign in to comment.