diff options
| author | Shulhan <ms@kilabit.info> | 2022-08-15 20:13:55 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-08-15 20:13:55 +0700 |
| commit | 8a6eaebb36c0761b21398e72d934c072ac67fa7f (patch) | |
| tree | 35150d19108888fb2c85b6d4743411121de4e493 /haminer.go | |
| parent | 2965b17ccc24abde2346c20ee1f9384ae6e12f20 (diff) | |
| download | haminer-8a6eaebb36c0761b21398e72d934c072ac67fa7f.tar.xz | |
all: add support for influxd API v2
This changes replace the "influxdb_api_write" with new section
`[forwarder "influxd"]`.
The section contains version, url, org, bucket, user, password, and
token.
The version field define the API version to be used when writing log
to Influxd.
Diffstat (limited to 'haminer.go')
| -rw-r--r-- | haminer.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -47,11 +47,15 @@ func NewHaminer(cfg *Config) (h *Haminer) { } func (h *Haminer) createForwarder() { - if len(h.cfg.InfluxAPIWrite) > 0 { - fwder := NewInfluxdbClient(h.cfg.InfluxAPIWrite) - - h.ff = append(h.ff, fwder) + if len(h.cfg.Influxd.Url) == 0 { + return } + + var ( + fwder = NewInfluxdbClient(&h.cfg.Influxd) + ) + + h.ff = append(h.ff, fwder) } // Start will listen for UDP packet and start consuming log, parse, and |
