diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/input_type_utils.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/input_type_utils.ts index dd1197a8ee2d7..3f3660582d493 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/input_type_utils.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/input_type_utils.ts @@ -11,6 +11,10 @@ import { STATE_DATASET_FIELD, AGENT_DATASET_FILEBEAT, AGENT_DATASET_METRICBEAT, + AGENT_DATASET_APM_SERVER, + AGENT_DATASET_ENDPOINT_SECURITY, + AGENT_DATASET_OSQUERYBEAT, + AGENT_DATASET_HEARTBEAT, } from '../agent_logs/constants'; export function displayInputType(inputType: string): string { @@ -40,6 +44,18 @@ export function getLogsQueryByInputType(inputType: string) { if (inputType.match(/\/metrics$/)) { return `(${STATE_DATASET_FIELD}:!(${AGENT_DATASET_METRICBEAT}))`; } + if (inputType === 'osquery') { + return `(${STATE_DATASET_FIELD}:!(${AGENT_DATASET_OSQUERYBEAT}))`; + } + if (inputType.match(/^synthetics\//)) { + return `(${STATE_DATASET_FIELD}:!(${AGENT_DATASET_HEARTBEAT}))`; + } + if (inputType === 'apm') { + return `(${STATE_DATASET_FIELD}:!(${AGENT_DATASET_APM_SERVER}))`; + } + if (inputType === 'endpoint') { + return `(${STATE_DATASET_FIELD}:!(${AGENT_DATASET_ENDPOINT_SECURITY}))`; + } return ''; } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/constants.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/constants.tsx index f4c6e19f09322..18af09c48f220 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/constants.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/constants.tsx @@ -11,6 +11,10 @@ export const AGENT_LOG_INDEX_PATTERN = 'logs-elastic_agent-*,logs-elastic_agent. export const AGENT_DATASET = 'elastic_agent'; export const AGENT_DATASET_FILEBEAT = 'elastic_agent.filebeat'; export const AGENT_DATASET_METRICBEAT = 'elastic_agent.metricbeat'; +export const AGENT_DATASET_OSQUERYBEAT = 'elastic_agent.osquerybeat'; +export const AGENT_DATASET_HEARTBEAT = 'elastic_agent.heartbeat'; +export const AGENT_DATASET_APM_SERVER = 'elastic_agent.apm_server'; +export const AGENT_DATASET_ENDPOINT_SECURITY = 'elastic_agent.endpoint_security'; export const AGENT_DATASET_PATTERN = 'elastic_agent.*'; export const AGENT_ID_FIELD = { name: 'elastic_agent.id',