-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Network community_id processor for ingest pipelines #66534
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
Network community_id processor for ingest pipelines #66534
Conversation
Pinging @elastic/es-core-features (Team:Core/Features) |
@andrewkroh, I would appreciate a look at this to see if it meets the criteria for #55685. I did replicate all the unit tests for the Beats community_id processor to verify that this processor produces the same values, so I'm reasonably confident about it in that regard. |
cc: @elastic/es-ui in case Kibana auto-complete needs to be updated with this new processor. |
Thanks @danhermann. I've opened elastic/kibana#86321 to track changes needed in Kibana. Can you also share the available options for this processor? |
Yes, I'll open a separate PR with the docs for this processor that will include all its available options. I'll tag you on that one when I open it. |
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.
This looks great. Just a minor comment from me.
|
||
Flow flow = new Flow(); | ||
try { | ||
flow.source = InetAddress.getByName(sourceIpAddrString); |
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.
I'm worried that this could potentially perform network calls to lookup IP addresses from names.
Luckily we have a utility for this that's safe. Can you use that package here?
elasticsearch/server/src/main/java/org/elasticsearch/common/network/InetAddresses.java
Line 340 in feab123
public static InetAddress forString(String ipString) { |
return transportNumber; | ||
} | ||
|
||
public static Transport fromNumber(int transportNumber) { |
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 sure if this is a worth it, so feel free to ignore. To ensure that fromNumber
stays up-to-date with all the enum transportNumbers it might be useful to have test that checks the all the Transport.values()
work with fromNumber
without exception.
@alisonelizabeth, the processor's options are documented here: #66592 |
Thanks, @andrewkroh! I've made both changes that you suggested. |
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.
LGTM
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.
For processors added in ingest-common
module there is a yaml test (Ingest common installed
) that ensures that processors are correct wired up. Maybe we should have such a test for the xpack ingest module as well? Then we verify that uri_parts
and community_id
processors have correctly been wired up and can be used in pipelines.
Ingest integration LGTM.
import static org.elasticsearch.ingest.ConfigurationUtils.newConfigurationException; | ||
import static org.elasticsearch.ingest.ConfigurationUtils.readBooleanProperty; | ||
|
||
public class CommunityIdProcessor extends AbstractProcessor { |
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.
make class final?
@elasticmachine update branch |
Thanks, @martijnvg! I'll open another PR with the module yaml test that you suggested. |
Adds a processor that computes the community_id for flow data according to the Community ID Specification.
For example:
populates the
network.community_id
field as below:Closes #55685