Co-authored-by: AlteredCoder <AlteredCoder>
This commit is contained in:
AlteredCoder 2020-07-20 17:44:45 +02:00 committed by GitHub
parent 66161bc8ae
commit 40b7bfaf69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,7 @@ func NewBackendPlugin(outputConfig map[string]string) (*BackendManager, error) {
log.Errorf("parsing '%s' yaml error : %s, skipping", file, err)
continue
}
plug, err := plugin.Open(newPlugin.Path)
if err != nil {
return nil, err
@ -100,8 +101,8 @@ func NewBackendPlugin(outputConfig map[string]string) (*BackendManager, error) {
// Add the interface and Init()
newPlugin.funcs = bInterface
// Merge backend config from main config file
if v, ok := outputConfig["debug"]; ok {
newPlugin.Config["debug"] = v
if v, ok := outputConfig["debug"]; ok && v == "true" {
newPlugin.Config["debug"] = "true"
}
if v, ok := outputConfig["max_records"]; ok {
@ -112,10 +113,9 @@ func NewBackendPlugin(outputConfig map[string]string) (*BackendManager, error) {
newPlugin.Config["max_records_age"] = v
}
if v, ok := outputConfig["flush"]; ok {
if v, ok := outputConfig["flush"]; ok && v == "true" {
newPlugin.Config["flush"] = v
}
err = newPlugin.funcs.Init(newPlugin.Config)
if err != nil {
return nil, fmt.Errorf("plugin '%s' init error : %s", newPlugin.Name, err)