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
Exclude non-message streams from search in aggregation events #17087
Conversation
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.
The current implementation produces different search query streams filters for aggregation events and for filter events. I think those two should be consistent.
@@ -219,7 +220,7 @@ private Set<String> getStreams(AggregationEventProcessorParameters parameters) { | |||
|
|||
private void filterSearch(EventFactory eventFactory, AggregationEventProcessorParameters parameters, | |||
EventConsumer<List<EventWithContext>> eventsConsumer) throws EventProcessorException { | |||
final Set<String> streams = getStreams(parameters); | |||
final Set<String> streams = eventStreamService.buildEventSourceStreams(getStreams(parameters), Collections.emptySet()); |
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 think this is the wrong method, because, as the name suggests, it is supposed to operate on the results of a search. I think we should use the same method that we use for aggregations here.
It appears as if that one will also take care of filtering out the investigation streams, if the enterprise plugin is present. Otherwise we'll end up using different stream filters on the search queries for aggregation and filter events.
* exclude non-message streams from default search * update CL * update CL * apply filtering to search query * use PermittedStreams for filter search
Relates to Graylog2/graylog-plugin-enterprise#6042
When no source stream is given for an event definition we use all streams in the ES/OS search query. We now exclude all non-message streams.
Motivation and Context
Users cannot select non-message streams as a source stream in the event definition. But these were still being included in the search when no source stream had been explicitly defined. This is unnecessary, inconsistent, and hurts performance. It may also push the search URI over the length limit, when there is a large number of streams.
Types of changes
Checklist: