-
Notifications
You must be signed in to change notification settings - Fork 12
Make to behave all unsupported processors in the same way. #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
import co.elastic.logstash.api.Event; | ||
import co.elastic.logstash.api.FilterMatchListener; | ||
import co.elastic.logstash.filters.elasticintegration.ingest.RedactPlugin; | ||
import co.elastic.logstash.filters.elasticintegration.ingest.SetSecurityUserProcessor; | ||
import co.elastic.logstash.filters.elasticintegration.ingest.SingleProcessorIngestPlugin; | ||
import co.elastic.logstash.filters.elasticintegration.resolver.CacheReloadService; | ||
import co.elastic.logstash.filters.elasticintegration.resolver.CachingResolver; | ||
|
@@ -33,7 +32,6 @@ | |
import org.elasticsearch.painless.PainlessPlugin; | ||
import org.elasticsearch.painless.PainlessScriptEngine; | ||
import org.elasticsearch.painless.spi.PainlessExtension; | ||
import org.elasticsearch.painless.spi.Whitelist; | ||
import org.elasticsearch.plugins.ExtensiblePlugin; | ||
import org.elasticsearch.plugins.IngestPlugin; | ||
import org.elasticsearch.script.IngestConditionalScript; | ||
|
@@ -128,7 +126,6 @@ public EventProcessorBuilder() { | |
org.elasticsearch.ingest.common.UriPartsProcessor.TYPE)); | ||
this.addProcessorsFromPlugin(IngestUserAgentPlugin::new); | ||
this.addProcessorsFromPlugin(RedactPlugin::new); | ||
this.addProcessor(SetSecurityUserProcessor.TYPE, SetSecurityUserProcessor.Factory::new); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any code references to I am +1 to deleting it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, we have unsupported processors scan automation and so far not appeared. |
||
} | ||
|
||
// event -> pipeline name | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +0,0 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. | ||
* under one or more contributor license agreements. Licensed under the | ||
* Elastic License 2.0; you may not use this file except in compliance | ||
* with the Elastic License 2.0. | ||
*/ | ||
package co.elastic.logstash.filters.elasticintegration.ingest; | ||
|
||
import org.elasticsearch.cluster.metadata.ProjectId; | ||
import org.elasticsearch.ingest.AbstractProcessor; | ||
import org.elasticsearch.ingest.IngestDocument; | ||
import org.elasticsearch.ingest.Processor; | ||
|
||
import java.util.Map; | ||
|
||
public class SetSecurityUserProcessor extends AbstractProcessor { | ||
|
||
public static final String TYPE = "set_security_user"; | ||
|
||
private SetSecurityUserProcessor(String tag, String description) { | ||
super(tag, description); | ||
} | ||
|
||
|
||
@Override | ||
public IngestDocument execute(IngestDocument ingestDocument) throws Exception { | ||
// within Logstash, the set_security_user processor is a no-op | ||
return ingestDocument; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return TYPE; | ||
} | ||
|
||
public static final class Factory implements Processor.Factory { | ||
|
||
@Override | ||
public SetSecurityUserProcessor create(Map<String, Processor.Factory> registry, String processorTag, | ||
String description, Map<String, Object> config, ProjectId projectId) { | ||
String[] supportedConfigs = {"field", "properties"}; | ||
for (String cfg : supportedConfigs) { | ||
config.remove(cfg); | ||
} | ||
return new SetSecurityUserProcessor(processorTag, description); | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used anywhere.