Skip to content

Commit

Permalink
Cherry-pick elastic#21932 to 7.10: [Elastic Agent] Fix index for Agen…
Browse files Browse the repository at this point in the history
…t monitoring to to elastic_agent. (elastic#21974)

* [Elastic Agent] Fix index for Agent monitoring to to elastic_agent. (elastic#21932)

* Change to elastic_agent.

* Add changelog.

(cherry picked from commit 3874725)

* Update CHANGELOG.next.asciidoc
  • Loading branch information
blakerouse authored Oct 20, 2020
1 parent f33533d commit 92d6be3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Include inputs in action store actions {pull}21298[21298]
- Fix issue where inputs without processors defined would panic {pull}21628[21628]
- Partial extracted beat result in failure to spawn beat {issue}21718[21718]
- Rename monitoring index from `elastic.agent` to `elastic_agent` {pull}21932[21932]

==== New features

Expand Down
18 changes: 9 additions & 9 deletions x-pack/elastic-agent/pkg/agent/operation/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
"paths": []string{
filepath.Join(paths.Home(), "logs", "elastic-agent-json.log"),
},
"index": "logs-elastic.agent-default",
"index": "logs-elastic_agent-default",
"processors": []map[string]interface{}{
{
"add_fields": map[string]interface{}{
"target": "data_stream",
"fields": map[string]interface{}{
"type": "logs",
"dataset": "elastic.agent",
"dataset": "elastic_agent",
"namespace": "default",
},
},
Expand All @@ -202,7 +202,7 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
"add_fields": map[string]interface{}{
"target": "event",
"fields": map[string]interface{}{
"dataset": "elastic.agent",
"dataset": "elastic_agent",
},
},
},
Expand All @@ -220,14 +220,14 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
"message_key": "message",
},
"paths": paths,
"index": fmt.Sprintf("logs-elastic.agent.%s-default", name),
"index": fmt.Sprintf("logs-elastic_agent.%s-default", name),
"processors": []map[string]interface{}{
{
"add_fields": map[string]interface{}{
"target": "data_stream",
"fields": map[string]interface{}{
"type": "logs",
"dataset": fmt.Sprintf("elastic.agent.%s", name),
"dataset": fmt.Sprintf("elastic_agent.%s", name),
"namespace": "default",
},
},
Expand All @@ -236,7 +236,7 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
"add_fields": map[string]interface{}{
"target": "event",
"fields": map[string]interface{}{
"dataset": fmt.Sprintf("elastic.agent.%s", name),
"dataset": fmt.Sprintf("elastic_agent.%s", name),
},
},
},
Expand Down Expand Up @@ -270,14 +270,14 @@ func (o *Operator) getMonitoringMetricbeatConfig(output interface{}) (map[string
"metricsets": []string{"stats", "state"},
"period": "10s",
"hosts": endpoints,
"index": fmt.Sprintf("metrics-elastic.agent.%s-default", name),
"index": fmt.Sprintf("metrics-elastic_agent.%s-default", name),
"processors": []map[string]interface{}{
{
"add_fields": map[string]interface{}{
"target": "data_stream",
"fields": map[string]interface{}{
"type": "metrics",
"dataset": fmt.Sprintf("elastic.agent.%s", name),
"dataset": fmt.Sprintf("elastic_agent.%s", name),
"namespace": "default",
},
},
Expand All @@ -286,7 +286,7 @@ func (o *Operator) getMonitoringMetricbeatConfig(output interface{}) (map[string
"add_fields": map[string]interface{}{
"target": "event",
"fields": map[string]interface{}{
"dataset": fmt.Sprintf("elastic.agent.%s", name),
"dataset": fmt.Sprintf("elastic_agent.%s", name),
},
},
},
Expand Down

0 comments on commit 92d6be3

Please sign in to comment.