Skip to content

Commit

Permalink
[Elastic Agent] Fix index for Agent monitoring to to elastic_agent. (e…
Browse files Browse the repository at this point in the history
…lastic#21932)

* Change to elastic_agent.

* Add changelog.

(cherry picked from commit 3874725)
  • Loading branch information
blakerouse committed Oct 19, 2020
1 parent f37edd6 commit 17eef74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions x-pack/elastic-agent/CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
- 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]
- Use local temp instead of system one {pull}21883[21883]
- 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 17eef74

Please sign in to comment.