Przeglądaj źródła

AMBARI-20766 Log Feeder fill cluster name if it is not set (mgergely)

Change-Id: I3220c6257d468dab965ff30bed808c4ad91e8399
Miklos Gergely 8 lat temu
rodzic
commit
6adc5856c5

+ 1 - 1
ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManager.java

@@ -78,7 +78,7 @@ public class OutputManager {
 
     // Update the block with the context fields
     for (Map.Entry<String, String> entry : input.getContextFields().entrySet()) {
-      if (jsonObj.get(entry.getKey()) == null) {
+      if (jsonObj.get(entry.getKey()) == null || entry.getKey().equals("cluster") && "null".equals(jsonObj.get(entry.getKey()))) {
         jsonObj.put(entry.getKey(), entry.getValue());
       }
     }