-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add StreamCategoryFilter and stream_category to StreamDTO #20110
Conversation
be0f84a
to
2ac60fa
Compare
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.
Looks like a solid start and tests successfully for me! Certainly touches quite a lot pieces of the application so nice job navigating that.
Left one comment on a thought I had, but definitely curious to hear feedback from those that have more experience with search.
graylog2-server/src/main/java/org/graylog/plugins/views/search/Query.java
Show resolved
Hide resolved
7d42e5f
to
ddec6c0
Compare
...java/org/graylog/plugins/views/search/engine/normalization/PluggableSearchNormalization.java
Show resolved
Hide resolved
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.
Looks good to me and tests successfully resolving streams from stream categories and filtering out streams that a search user does not have access to.
I like this CommandFactory
/PluggableSearchNormalization
approach.
@ryan-carroll-graylog I made one more change moving the |
Right on, tests successfully with the latest as well. |
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.
Ran through again with the latest and all looks good and is testing successfully for me.
Left a couple minor nit comments for consideration but otherwise this is looks solid from my perspective.
graylog2-server/src/main/java/org/graylog/plugins/views/search/Search.java
Outdated
Show resolved
Hide resolved
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 and tests successfully!
graylog2-server/src/main/java/org/graylog/plugins/views/search/Query.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog/plugins/views/search/Search.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog/plugins/views/search/Query.java
Outdated
Show resolved
Hide resolved
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.
Thanks a lot!!!
Some initial code implementation to allow for Stream categories in support of Graylog2/graylog-plugin-enterprise#7945 and specifically Graylog2/graylog-plugin-enterprise#7926.
Description
categories
field toStreamDTO
StreamCategoryFilter
StreamServiceImpl
to map stream categories to stream IDsQuery
to treat aStreamCategoryFilter
similar to having aStreamFilter
setStreamCategoryFilter
s to the appropriateStreamFilter
s during search normalizationThis works specifically on queries from the search bar hitting the
Search
API endpoints. Widgets will be handled in a subsequent PR. I am mostly looking for feedback on if this stream category -> stream ID mapping as part of search normalization is a viable option and, if so, anywhere that I may have missed accounting for stream categories.Motivation and Context
Graylog2/graylog-plugin-enterprise#7926
How Has This Been Tested?
Testing from the API browser is a bit involved at the moment, but it looks something like this:
db.streams.updateOne({title:'Random'}, {$set:{categories: ['firewall']}})
StreamCategoryFilter
using the/views/search
API endpoint. The following example is for 200 response codes from the random HTTP input:query
ID and paste it into the/views/search/{id}/execute
API endpoint. The top level ID will go into the{id}
path parameter and the body will be:id
andexecuting_node
to be used in the/views/searchjobs/{nodeId}/{jobId}/status
API endpoint. Theid
corresponds to thejobId
andexecuting_node
tonodeId
. This call should return the search query containing theStreamCategoryFilter
and search results from the stream with the category assigned in the first step.Screenshots (if appropriate):
Types of changes
Checklist: