Skip to content

Commit

Permalink
Inherit Kibana credentials from the ES output (elastic#6993)
Browse files Browse the repository at this point in the history
This uses the same approach and code as the Kibana dashboards
loader.

Fixes elastic#6921.
  • Loading branch information
tsg authored and Steffen Siering committed May 2, 2018
1 parent 028a3fd commit b514dd1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions filebeat/beater/filebeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@ func (fb *Filebeat) loadModulesML(b *beat.Beat, kibanaConfig *common.Config) err
kibanaConfig = common.NewConfig()
}

if esConfig.Enabled() {
username, _ := esConfig.String("username", -1)
password, _ := esConfig.String("password", -1)

if !kibanaConfig.HasField("username") && username != "" {
kibanaConfig.SetString("username", -1, username)
}
if !kibanaConfig.HasField("password") && password != "" {
kibanaConfig.SetString("password", -1, password)
}
}

kibanaClient, err := kibana.NewKibanaClient(kibanaConfig)
if err != nil {
return errors.Errorf("Error creating Kibana client: %v", err)
Expand Down

0 comments on commit b514dd1

Please sign in to comment.