Skip to content

Commit 3ea5144

Browse files
author
Shikhar Dhawale
committed
Add debug logging when indirect field references are dropped in dissect processor
Signed-off-by: Shikhar Dhawale <shikhar_dhawale@apple.com>
1 parent 87bf9e8 commit 3ea5144

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • data-prepper-plugins/dissect-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/dissect

data-prepper-plugins/dissect-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/dissect/Dissector.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,15 @@ private Map<String, String> getDissectedFields(Map<Field, String> localValues) {
135135
} else if (appendFieldMap.containsKey(templateKey)) {
136136
resolvedKey = appendFieldMap.get(templateKey);
137137
}
138+
if (resolvedKey == null || resolvedKey.isEmpty()) {
139+
LOG.debug("Indirect field reference %{&{}} could not be resolved; dropping value", templateKey);
140+
continue;
141+
}
138142
String val = localValues.get(templateField);
139-
if (resolvedKey != null && !resolvedKey.isEmpty() && val != null) {
143+
if (val != null) {
140144
results.put(resolvedKey, val);
145+
} else {
146+
LOG.debug("Indirect field reference %{&{}} had no captured value; dropping", templateKey);
141147
}
142148
}
143149
return results;

0 commit comments

Comments
 (0)