Skip to content

Commit

Permalink
README.md updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Sep 8, 2021
1 parent ef07ed6 commit 57ad447
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ With this example the collector waits incoming dnstap messages sent by dns serve

The full config file for this use-case can be found [here](example-config/use-case-1.yml)

### Use case 2: collect dnstap stream and generate metrics for prometheus

With this example the collector waits incoming dnstap messages sent by dns server and then you
can requested the api to get some dns metrics for prometheus.

The full config file for this use-case can be found [here](example-config/use-case-2.yml)

## Benchmark

Tested on the following machine: 8 vCPUs, 32 GB memory
Expand Down
10 changes: 3 additions & 7 deletions example-config/use-case-1.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
trace:
verbose: true

collectors:
dnstap:
enable: true
listen-ip: 0.0.0.0
listen-port: 6000
sock-path: null
tls-support: true
cert-file: "/etc/dnscollector/dnscollector.crt"
key-file: "/etc/dnscollector/dnscollector.key"
Expand All @@ -14,10 +16,4 @@ loggers:
file-path: "/var/run/dnscollector/dnstap.log"
max-size: 100
max-files: 10
flush-interval: 10
compress: false
compress-interval: 5
mode: text
text-format: ""
postrotate-command: null
postrotate-delete-success: true
22 changes: 22 additions & 0 deletions example-config/use-case-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
trace:
verbose: true

collectors:
dnstap:
enable: true
listen-ip: 0.0.0.0
listen-port: 6000
tls-support: true
cert-file: "/etc/dnscollector/dnscollector.crt"
key-file: "/etc/dnscollector/dnscollector.key"

loggers:
webserver:
enable: true
listen-ip: 0.0.0.0
listen-port: 8080
basic-auth-login: admin
basic-auth-pwd: changeme
tls-support: true
cert-file: "/etc/dnscollector/dnscollector.crt"
key-file: "/etc/dnscollector/dnscollector.key"
2 changes: 1 addition & 1 deletion loggers/logfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func (o *LogFile) Rotate() error {
}

func (o *LogFile) Run() {
o.LogInfo("unning in background...")
o.LogInfo("running in background...")

tflush_interval := time.Duration(o.config.Loggers.LogFile.FlushInterval) * time.Second
tflush := time.NewTimer(tflush_interval)
Expand Down

0 comments on commit 57ad447

Please sign in to comment.