diff --git a/x-pack/plugins/osquery/public/agents/use_all_agents.ts b/x-pack/plugins/osquery/public/agents/use_all_agents.ts index 12b98bccc0ed5..7d09470397e76 100644 --- a/x-pack/plugins/osquery/public/agents/use_all_agents.ts +++ b/x-pack/plugins/osquery/public/agents/use_all_agents.ts @@ -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 ')})` : ''