Skip to content

Commit 7e7ad4e

Browse files
committed
reverts rules table tag filters to AND operator:
1 parent 128485c commit 7e7ad4e

File tree

2 files changed

+3
-3
lines changed
  • x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules

2 files changed

+3
-3
lines changed

x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe('Detections Rules API', () => {
202202
expect(fetchMock).toHaveBeenCalledWith('/api/detection_engine/rules/_find', {
203203
method: 'GET',
204204
query: {
205-
filter: 'alert.attributes.tags: "hello" OR alert.attributes.tags: "world"',
205+
filter: 'alert.attributes.tags: "hello" AND alert.attributes.tags: "world"',
206206
page: 1,
207207
per_page: 20,
208208
sort_field: 'enabled',
@@ -297,7 +297,7 @@ describe('Detections Rules API', () => {
297297
method: 'GET',
298298
query: {
299299
filter:
300-
'alert.attributes.name: ruleName AND alert.attributes.tags: "__internal_immutable:false" AND alert.attributes.tags: "__internal_immutable:true" AND (alert.attributes.tags: "hello" OR alert.attributes.tags: "world")',
300+
'alert.attributes.name: ruleName AND alert.attributes.tags: "__internal_immutable:false" AND alert.attributes.tags: "__internal_immutable:true" AND (alert.attributes.tags: "hello" AND alert.attributes.tags: "world")',
301301
page: 1,
302302
per_page: 20,
303303
sort_field: 'enabled',

x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const fetchRules = async ({
119119

120120
const tags = [
121121
...(filterOptions.tags?.map((t) => `alert.attributes.tags: "${t.replace(/"/g, '\\"')}"`) ?? []),
122-
].join(' OR ');
122+
].join(' AND ');
123123

124124
const filterString =
125125
filtersWithoutTags !== '' && tags !== ''

0 commit comments

Comments
 (0)