aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/config.go b/config.go
index 79d08f5..857a392 100644
--- a/config.go
+++ b/config.go
@@ -31,6 +31,8 @@ const (
// Config define options to create and run Haminer instance.
type Config struct {
+ Influxd InfluxdConfig
+
// Listen is the address where Haminer will bind and receiving
// log from HAProxy.
Listen string `ini:"haminer::listen"`
@@ -44,9 +46,6 @@ type Config struct {
// output.
RequestHeaders []string `ini:"haminer::capture_request_header"`
- // InfluxAPIWrite define HTTP API to write to Influxdb.
- InfluxAPIWrite string `ini:"haminer::influxdb_api_write"`
-
HttpUrl []string `ini:"preprocess:tag:http_url"`
// retags contains list of pre-processing rules for tag.
@@ -99,6 +98,11 @@ func (cfg *Config) Load(path string) (err error) {
return fmt.Errorf(`%s: %w`, logp, err)
}
+ err = cfg.Influxd.init()
+ if err != nil {
+ return fmt.Errorf(`%s: %w`, logp, err)
+ }
+
return nil
}
@@ -143,6 +147,9 @@ func (cfg *Config) parsePreprocessTag() (err error) {
if err != nil {
return fmt.Errorf(`%s: %w`, logp, err)
}
+ if retag == nil {
+ continue
+ }
cfg.retags = append(cfg.retags, retag)
}