Skip to content

Commit

Permalink
Remove cluster_uuid from vertices (#13132)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator authored Aug 1, 2019
1 parent 1b4581d commit edb6989
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions metricbeat/module/logstash/node/data_xpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func eventMappingXPack(r mb.ReporterV2, m *MetricSet, pipelines []logstash.Pipel
clusterToPipelinesMap := makeClusterToPipelinesMap(pipelines)
for clusterUUID, pipelines := range clusterToPipelinesMap {
for _, pipeline := range pipelines {
removeClusterUUIDsFromPipeline(pipeline)

// Rename key: graph -> representation
pipeline.Representation = pipeline.Graph
pipeline.Graph = nil
Expand Down Expand Up @@ -107,3 +109,14 @@ func getUserDefinedPipelines(pipelines []logstash.PipelineState) []logstash.Pipe
}
return userDefinedPipelines
}

func removeClusterUUIDsFromPipeline(pipeline logstash.PipelineState) {
for _, vertex := range pipeline.Graph.Graph.Vertices {
_, exists := vertex["cluster_uuid"]
if !exists {
continue
}

delete(vertex, "cluster_uuid")
}
}

0 comments on commit edb6989

Please sign in to comment.