Skip to content

Commit

Permalink
[8.12] [EDR Workflows] Fix agent select field in Osquery bug with &#x…
Browse files Browse the repository at this point in the history
…60;-` (#175134) (#175218)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[EDR Workflows] Fix agent select field in Osquery bug with
`-` (#175134)](#175134)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tomasz
Ciecierski","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-22T14:52:51Z","message":"[EDR
Workflows] Fix agent select field in Osquery bug with `-`
(#175134)","sha":"a6e982e848e79c36da4c375866ec8b3b33613537","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Defend
Workflows","Feature:Osquery","ci:all-cypress-suites","v8.12.1","v8.13.0"],"title":"[EDR
Workflows] Fix agent select field in Osquery bug with `-`
","number":175134,"url":"https://github.com/elastic/kibana/pull/175134","mergeCommit":{"message":"[EDR
Workflows] Fix agent select field in Osquery bug with `-`
(#175134)","sha":"a6e982e848e79c36da4c375866ec8b3b33613537"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175134","number":175134,"mergeCommit":{"message":"[EDR
Workflows] Fix agent select field in Osquery bug with `-`
(#175134)","sha":"a6e982e848e79c36da4c375866ec8b3b33613537"}}]}]
BACKPORT-->

Co-authored-by: Tomasz Ciecierski <[email protected]>
  • Loading branch information
kibanamachine and tomsonpl authored Jan 22, 2024
1 parent d8a6910 commit 79a76da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/plugins/osquery/public/agents/use_all_agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useAllAgents = (searchValue = '', opts: RequestOptions = { perPage:
kuery = `(${osqueryPolicies.map((p) => `policy_id:${p}`).join(' or ')})`;

if (searchValue) {
kuery += ` and (local_metadata.host.hostname:*${searchValue}* or local_metadata.elastic.agent.id:*${searchValue}*)`;
kuery += ` and (local_metadata.host.hostname.keyword:*${searchValue}* or local_metadata.elastic.agent.id:*${searchValue}*)`;
} else {
kuery += ` and (status:online ${
agentIds?.length ? `or local_metadata.elastic.agent.id:(${agentIds.join(' or ')})` : ''
Expand Down

0 comments on commit 79a76da

Please sign in to comment.