Skip to content

Commit 3874725

Browse files
authored
[Elastic Agent] Fix index for Agent monitoring to to elastic_agent. (#21932)
* Change to elastic_agent. * Add changelog.
1 parent ee7d329 commit 3874725

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

x-pack/elastic-agent/CHANGELOG.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Prevent reporting ecs version twice {pull}21616[21616]
1919
- Partial extracted beat result in failure to spawn beat {issue}21718[21718]
2020
- Use local temp instead of system one {pull}21883[21883]
21+
- Rename monitoring index from `elastic.agent` to `elastic_agent` {pull}21932[21932]
2122

2223
==== New features
2324

x-pack/elastic-agent/pkg/agent/operation/monitoring.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
186186
"paths": []string{
187187
filepath.Join(paths.Home(), "logs", "elastic-agent-json.log"),
188188
},
189-
"index": "logs-elastic.agent-default",
189+
"index": "logs-elastic_agent-default",
190190
"processors": []map[string]interface{}{
191191
{
192192
"add_fields": map[string]interface{}{
193193
"target": "data_stream",
194194
"fields": map[string]interface{}{
195195
"type": "logs",
196-
"dataset": "elastic.agent",
196+
"dataset": "elastic_agent",
197197
"namespace": "default",
198198
},
199199
},
@@ -202,7 +202,7 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
202202
"add_fields": map[string]interface{}{
203203
"target": "event",
204204
"fields": map[string]interface{}{
205-
"dataset": "elastic.agent",
205+
"dataset": "elastic_agent",
206206
},
207207
},
208208
},
@@ -220,14 +220,14 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
220220
"message_key": "message",
221221
},
222222
"paths": paths,
223-
"index": fmt.Sprintf("logs-elastic.agent.%s-default", name),
223+
"index": fmt.Sprintf("logs-elastic_agent.%s-default", name),
224224
"processors": []map[string]interface{}{
225225
{
226226
"add_fields": map[string]interface{}{
227227
"target": "data_stream",
228228
"fields": map[string]interface{}{
229229
"type": "logs",
230-
"dataset": fmt.Sprintf("elastic.agent.%s", name),
230+
"dataset": fmt.Sprintf("elastic_agent.%s", name),
231231
"namespace": "default",
232232
},
233233
},
@@ -236,7 +236,7 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
236236
"add_fields": map[string]interface{}{
237237
"target": "event",
238238
"fields": map[string]interface{}{
239-
"dataset": fmt.Sprintf("elastic.agent.%s", name),
239+
"dataset": fmt.Sprintf("elastic_agent.%s", name),
240240
},
241241
},
242242
},
@@ -270,14 +270,14 @@ func (o *Operator) getMonitoringMetricbeatConfig(output interface{}) (map[string
270270
"metricsets": []string{"stats", "state"},
271271
"period": "10s",
272272
"hosts": endpoints,
273-
"index": fmt.Sprintf("metrics-elastic.agent.%s-default", name),
273+
"index": fmt.Sprintf("metrics-elastic_agent.%s-default", name),
274274
"processors": []map[string]interface{}{
275275
{
276276
"add_fields": map[string]interface{}{
277277
"target": "data_stream",
278278
"fields": map[string]interface{}{
279279
"type": "metrics",
280-
"dataset": fmt.Sprintf("elastic.agent.%s", name),
280+
"dataset": fmt.Sprintf("elastic_agent.%s", name),
281281
"namespace": "default",
282282
},
283283
},
@@ -286,7 +286,7 @@ func (o *Operator) getMonitoringMetricbeatConfig(output interface{}) (map[string
286286
"add_fields": map[string]interface{}{
287287
"target": "event",
288288
"fields": map[string]interface{}{
289-
"dataset": fmt.Sprintf("elastic.agent.%s", name),
289+
"dataset": fmt.Sprintf("elastic_agent.%s", name),
290290
},
291291
},
292292
},

0 commit comments

Comments
 (0)