Skip to content

Commit

Permalink
[Fleet] Fix links to Agent logs for apm, endpoint, synthetics, osquery
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Mar 10, 2022
1 parent 9707679 commit c50b404
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 '';
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit c50b404

Please sign in to comment.