Skip to content

Commit

Permalink
Cherry-pick #8259 to 6.x: Cleanup: xpack code for `elasticsearch/inde…
Browse files Browse the repository at this point in the history
…x_summary` metricset (#8298)

Cherry-pick of PR #8259 to 6.x branch. Original message: 

This PR cleans up a couple of small things in the x-pack code of the `elasticsearch/index_summary` metricset:

- It un-hardcodes the name of the monitoring index that events will be reported into.
- It does not report errors as they will end up in `metricbeat-*` indices.
  • Loading branch information
ycombinator authored Sep 13, 2018
1 parent e6220c2 commit 6a295f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metricbeat/module/elasticsearch/index_summary/data_xpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/elastic/beats/libbeat/common"
s "github.com/elastic/beats/libbeat/common/schema"
c "github.com/elastic/beats/libbeat/common/schema/mapstriface"
"github.com/elastic/beats/metricbeat/helper/elastic"
"github.com/elastic/beats/metricbeat/mb"
"github.com/elastic/beats/metricbeat/module/elasticsearch"
)
Expand Down Expand Up @@ -76,7 +77,6 @@ func eventMappingXPack(r mb.ReporterV2, m *MetricSet, info elasticsearch.Info, c

err := json.Unmarshal(content, &all)
if err != nil {
r.Error(err)
return []error{err}
}

Expand Down Expand Up @@ -105,7 +105,7 @@ func eventMappingXPack(r mb.ReporterV2, m *MetricSet, info elasticsearch.Info, c
event.RootFields.Put("type", "indices_stats")
event.RootFields.Put("source_node", sourceNode)

event.Index = ".monitoring-es-6-mb"
event.Index = elastic.MakeXPackMonitoringIndexName(elastic.Elasticsearch)

r.Event(event)

Expand Down

0 comments on commit 6a295f7

Please sign in to comment.