Skip to content

Commit 8fd6e58

Browse files
cachedoutycombinator
authored andcommitted
Add cluster UUID
Fixes #10561
1 parent a8806b1 commit 8fd6e58

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

logstash-core/lib/logstash/api/commands/node.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def pipeline(pipeline_id)
3636
:config_reload_automatic,
3737
:config_reload_interval,
3838
:dead_letter_queue_enabled,
39-
:dead_letter_queue_path
39+
:dead_letter_queue_path,
40+
:cluster_uuids
4041
).reject{|_, v|v.nil?}
4142
rescue
4243
{}

logstash-core/lib/logstash/java_pipeline.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def start_workers
220220
config_metric.gauge(:ephemeral_id, ephemeral_id)
221221
config_metric.gauge(:hash, lir.unique_hash)
222222
config_metric.gauge(:graph, ::LogStash::Config::LIRSerializer.serialize(lir))
223+
config_metric.gauge(:cluster_uuids, resolve_cluster_uuids)
223224

224225
@logger.info("Starting pipeline", default_logging_keys(
225226
"pipeline.workers" => pipeline_workers,
@@ -258,6 +259,19 @@ def start_workers
258259
end
259260
end
260261

262+
def resolve_cluster_uuids
263+
cluster_uuids = []
264+
outputs.each do |output|
265+
if LogStash::SETTINGS.registered?(output.id + ".cluster_uuid")
266+
cluster_uuid = LogStash::SETTINGS.get(output.id + ".cluster_uuid")
267+
unless cluster_uuids.include? cluster_uuid
268+
cluster_uuids.push(cluster_uuid)
269+
end
270+
end
271+
end
272+
cluster_uuids
273+
end
274+
261275
def wait_inputs
262276
@input_threads.each do |thread|
263277
if thread.class == Java::JavaObject

0 commit comments

Comments
 (0)