diff --git a/buildSrc/src/main/resources/checkstyle_suppressions.xml b/buildSrc/src/main/resources/checkstyle_suppressions.xml
index 6432ccb3ddd..c77ef0f9d5b 100644
--- a/buildSrc/src/main/resources/checkstyle_suppressions.xml
+++ b/buildSrc/src/main/resources/checkstyle_suppressions.xml
@@ -1037,11 +1037,6 @@
-
-
-
-
-
diff --git a/core/src/main/java/org/elasticsearch/ingest/core/CompoundProcessor.java b/core/src/main/java/org/elasticsearch/ingest/core/CompoundProcessor.java
index fb10f8a1927..652a2c184a2 100644
--- a/core/src/main/java/org/elasticsearch/ingest/core/CompoundProcessor.java
+++ b/core/src/main/java/org/elasticsearch/ingest/core/CompoundProcessor.java
@@ -38,19 +38,25 @@ public class CompoundProcessor implements Processor {
public static final String ON_FAILURE_PROCESSOR_TYPE_FIELD = "on_failure_processor_type";
public static final String ON_FAILURE_PROCESSOR_TAG_FIELD = "on_failure_processor_tag";
+ private final boolean ignoreFailure;
private final List processors;
private final List onFailureProcessors;
public CompoundProcessor(Processor... processor) {
- this(Arrays.asList(processor), Collections.emptyList());
+ this(false, Arrays.asList(processor), Collections.emptyList());
}
- public CompoundProcessor(List processors, List onFailureProcessors) {
+ public CompoundProcessor(boolean ignoreFailure, List processors, List onFailureProcessors) {
super();
+ this.ignoreFailure = ignoreFailure;
this.processors = processors;
this.onFailureProcessors = onFailureProcessors;
}
+ public boolean isIgnoreFailure() {
+ return ignoreFailure;
+ }
+
public List getOnFailureProcessors() {
return onFailureProcessors;
}
@@ -93,6 +99,10 @@ public class CompoundProcessor implements Processor {
try {
processor.execute(ingestDocument);
} catch (Exception e) {
+ if (ignoreFailure) {
+ continue;
+ }
+
ElasticsearchException compoundProcessorException = newCompoundProcessorException(e, processor.getType(), processor.getTag());
if (onFailureProcessors.isEmpty()) {
throw compoundProcessorException;
diff --git a/core/src/main/java/org/elasticsearch/ingest/core/ConfigurationUtils.java b/core/src/main/java/org/elasticsearch/ingest/core/ConfigurationUtils.java
index 685f6f41de3..20370430bdc 100644
--- a/core/src/main/java/org/elasticsearch/ingest/core/ConfigurationUtils.java
+++ b/core/src/main/java/org/elasticsearch/ingest/core/ConfigurationUtils.java
@@ -250,6 +250,7 @@ public final class ConfigurationUtils {
private static Processor readProcessor(ProcessorsRegistry processorRegistry, String type, Map config) throws Exception {
Processor.Factory factory = processorRegistry.getProcessorFactory(type);
if (factory != null) {
+ boolean ignoreFailure = ConfigurationUtils.readBooleanProperty(null, null, config, "ignore_failure", false);
List