From c6cfb31fc06d48678e3dc05f948118fea43d628e Mon Sep 17 00:00:00 2001 From: Ilya Margolin Date: Mon, 17 Oct 2016 19:19:22 +0200 Subject: [PATCH] Retrieve build data again when the slave is known --- src/main/java/jenkins/plugins/logstash/LogstashWriter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/jenkins/plugins/logstash/LogstashWriter.java b/src/main/java/jenkins/plugins/logstash/LogstashWriter.java index 06bbc984..77d1cdd9 100644 --- a/src/main/java/jenkins/plugins/logstash/LogstashWriter.java +++ b/src/main/java/jenkins/plugins/logstash/LogstashWriter.java @@ -53,7 +53,7 @@ public class LogstashWriter { final OutputStream errorStream; final AbstractBuild build; - final BuildData buildData; + BuildData buildData; final String jenkinsUrl; final LogstashIndexerDao dao; private boolean connectionBroken; @@ -81,6 +81,9 @@ public LogstashWriter(AbstractBuild build, OutputStream error) { * Message, not null */ public void write(String line) { + if (line.contains("Building remotely")) { + this.buildData = getBuildData(); + } if (!isConnectionBroken() && StringUtils.isNotEmpty(line)) { this.write(Arrays.asList(line)); }