-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[Security Solution] [142435] add is one of operator #144988
[Security Solution] [142435] add is one of operator #144988
Conversation
…thub.com:jamster10/kibana into 142435-add-is-one-of-operator-for-data-providers
...urity_solution/public/timelines/components/edit_data_provider/components/components.test.tsx
Outdated
Show resolved
Hide resolved
...tion/public/timelines/components/edit_data_provider/components/controlled_combobox_input.tsx
Outdated
Show resolved
Hide resolved
...tion/public/timelines/components/edit_data_provider/components/controlled_combobox_input.tsx
Outdated
Show resolved
Hide resolved
...tion/public/timelines/components/edit_data_provider/components/controlled_combobox_input.tsx
Outdated
Show resolved
Hide resolved
...ution/public/timelines/components/edit_data_provider/components/controlled_default_input.tsx
Show resolved
Hide resolved
...ck/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.test.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx
Outdated
Show resolved
Hide resolved
...ck/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx
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.
@jamster10 thanks for enhancing Timeline's Data Providers to implement the is one of
and is not one of
operators! 🙏
- For users, this feature adds additional expressiveness to Timeline's query builder
- For developers, existing
Investigate in timeline
actions may, pending addtional support for overriding labels, integrate with this feature to use Data Providers instead of filters
Desk tested locally
LGTM 🚀
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @jamster10 |
## Summary This PR adds support for an is one of operator allowing users to filter multiple values for one field. [Some investigation ](https://discuss.elastic.co/t/passing-multiple-values-in-kibana-add-filter-is-one-of/232694/2)by @andrew-goldstein revealed that since the underlying engine uses Lucene, we can add support for multiple values by using an OR query: `kibana.alert.workflow_status: ("open" OR "closed" OR "acknowledged")` is equivalent to ``` "terms": { "kibana.alert.workflow_status": [ "open", "closed", "acknowledged"] } ``` Where the former is usable in our `DataProviders` used by timeline and other components that navigate a user to a pre-populated timeline. As an enhancement to the timeline view, users can also use this `is one of` operator by interacting with the `Add field` button and selecting the new operator. <img width="433" alt="image" src="https://user-images.githubusercontent.com/28942857/193487154-769005b6-3e5a-40bf-9476-8dd3f3bcb8ee.png"> ### Checklist Delete any items that are not applicable to this PR. - [X] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [X] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ## Known issues This operator does not support timeline templates at this time so usage there disables the ability for conversion to template field but a better approach should be implemented to notify users. elastic#142437. For now I have added a template message and prevented users from creating templates with this operator: <img width="374" alt="image" src="https://user-images.githubusercontent.com/28942857/201157676-80017c6c-9f5b-4cd7-ba0b-ee2e43a884cb.png"> ## Testing Create a new timeline or visit an existing one. Click 'Add field' button on Timeline in OR query section add any field ( preferably one that can have many values- consider `kibana.alerts.workflow_status` but this requires alerts. Select the `is one of` or `is not one of operator` Add or remove values in the value section. Click save. Co-authored-by: Kristof-Pierre Cummings <kristofpierre.cummings@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR adds support for an is one of operator allowing users to filter multiple values for one field.
Some investigation by @andrew-goldstein revealed that since the underlying engine uses Lucene, we can add support for multiple values by using an OR query:
kibana.alert.workflow_status: ("open" OR "closed" OR "acknowledged")
is equivalent toWhere the former is usable in our
DataProviders
used by timeline and other components that navigate a user to a pre-populated timeline.As an enhancement to the timeline view, users can also use this
is one of
operator by interacting with theAdd field
button and selecting the new operator.Checklist
Delete any items that are not applicable to this PR.
Known issues
This operator does not support timeline templates at this time so usage there disables the ability for conversion to template field but a better approach should be implemented to notify users. #142437. For now I have added a template message and prevented users from creating templates with this operator:
Testing
Create a new timeline or visit an existing one.
Click 'Add field' button on Timeline in OR query section
add any field ( preferably one that can have many values- consider
kibana.alerts.workflow_status
but this requires alerts.Select the
is one of
oris not one of operator
Add or remove values in the value section.
Click save.