Skip to content

Commit

Permalink
add elasticsearch.cluster.id to logstash metricsets (#29625)
Browse files Browse the repository at this point in the history
* add elasticsearch.cluster.id to logstash metricsets

* changelog entry
  • Loading branch information
klacabane authored Dec 29, 2021
1 parent 4ae6306 commit 1386a04
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add `container.id` and `container.runtime` ECS fields in container metricset. {pull}29560[29560]
- Add `memory.workingset.limit.pct` field in Kubernetes container/pod metricset. {pull}29547[29547]
- Add `elasticsearch.cluster.id` field to Beat and Kibana modules. {pull}29577[29577]
- Add `elasticsearch.cluster.id` field to Logstash module. {pull}29625[29625]

*Packetbeat*

Expand Down
7 changes: 7 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46325,6 +46325,13 @@ alias to: logstash.node.state.pipeline.hash
--


*`logstash.elasticsearch.cluster.id`*::
+
--
type: keyword

--

[float]
=== node

Expand Down
2 changes: 2 additions & 0 deletions metricbeat/module/logstash/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@
- name: logstash
type: group
fields:
- name: elasticsearch.cluster.id
type: keyword
2 changes: 1 addition & 1 deletion metricbeat/module/logstash/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion metricbeat/module/logstash/node/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"cluster": {
"id": "VUwnkX_lTzCFP9VUoXT1IQ"
},
"elasticsearch": {
"cluster": {
"id": "VUwnkX_lTzCFP9VUoXT1IQ"
}
},
"node": {
"host": "7dc1b688baf4",
"id": "9a1f83e1-52b9-4625-a98a-6aa336f41719",
Expand Down Expand Up @@ -101,4 +106,4 @@
"type": "logstash",
"version": "7.12.0"
}
}
}
1 change: 1 addition & 0 deletions metricbeat/module/logstash/node/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func eventMapping(r mb.ReporterV2, content []byte, pipelines []logstash.Pipeline

if clusterUUID != "" {
event.ModuleFields.Put("cluster.id", clusterUUID)
event.ModuleFields.Put("elasticsearch.cluster.id", clusterUUID)
}

event.ID = pipeline.EphemeralID
Expand Down
11 changes: 9 additions & 2 deletions metricbeat/module/logstash/node_stats/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
"module": "logstash"
},
"logstash": {
"cluster.id": "VUwnkX_lTzCFP9VUoXT1IQ",
"cluster": {
"id": "VUwnkX_lTzCFP9VUoXT1IQ"
},
"elasticsearch": {
"cluster": {
"id": "VUwnkX_lTzCFP9VUoXT1IQ"
}
},
"node": {
"stats": {
"events": {
Expand Down Expand Up @@ -136,4 +143,4 @@
"type": "logstash",
"version": "7.12.0"
}
}
}
3 changes: 2 additions & 1 deletion metricbeat/module/logstash/node_stats/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ func eventMapping(r mb.ReporterV2, content []byte, isXpack bool) error {
event.RootFields.Put("service.version", nodeStats.Version)

if clusterUUID != "" {
event.ModuleFields["cluster.id"] = clusterUUID
event.ModuleFields.Put("cluster.id", clusterUUID)
event.ModuleFields.Put("elasticsearch.cluster.id", clusterUUID)
}

// xpack.enabled in config using standalone metricbeat writes to `.monitoring` instead of `metricbeat-*`
Expand Down

0 comments on commit 1386a04

Please sign in to comment.