fluent-bit plugin support tls (#2568)

pull/2614/head^2
Jiajin Zheng 5 years ago committed by GitHub
parent bffd9a5c98
commit 1b2bae46ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      cmd/fluent-bit/config.go
  2. 5
      cmd/fluent-bit/out_loki.go

@ -258,5 +258,19 @@ func parseConfig(cfg ConfigGetter) (*config, error) {
res.bufferConfig.dqueConfig.queueName = queueName
}
res.clientConfig.Client.TLSConfig.CAFile = cfg.Get("ca_file")
res.clientConfig.Client.TLSConfig.CertFile = cfg.Get("cert_file")
res.clientConfig.Client.TLSConfig.KeyFile = cfg.Get("key_file")
insecureSkipVerify := cfg.Get("insecure_skip_verify")
switch insecureSkipVerify {
case "false", "":
res.clientConfig.Client.TLSConfig.InsecureSkipVerify = false
case "true":
res.clientConfig.Client.TLSConfig.InsecureSkipVerify = true
default:
return nil, fmt.Errorf("invalid string insecure_skip_verify: %v", insecureSkipVerify)
}
return res, nil
}

@ -77,6 +77,11 @@ func FLBPluginInit(ctx unsafe.Pointer) int {
level.Info(paramLogger).Log("DqueDir", conf.bufferConfig.dqueConfig.queueDir)
level.Info(paramLogger).Log("DqueSegmentSize", conf.bufferConfig.dqueConfig.queueSegmentSize)
level.Info(paramLogger).Log("DqueSync", conf.bufferConfig.dqueConfig.queueSync)
level.Info(paramLogger).Log("ca_file", conf.clientConfig.Client.TLSConfig.CAFile)
level.Info(paramLogger).Log("cert_file", conf.clientConfig.Client.TLSConfig.CertFile)
level.Info(paramLogger).Log("key_file", conf.clientConfig.Client.TLSConfig.KeyFile)
level.Info(paramLogger).Log("insecure_skip_verify", conf.clientConfig.Client.TLSConfig.InsecureSkipVerify)
plugin, err := newPlugin(conf, logger)
if err != nil {
level.Error(logger).Log("newPlugin", err)

Loading…
Cancel
Save