Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Revert "Using correct index patterns (elastic#69208)"
Browse files Browse the repository at this point in the history
This reverts commit 106d35d.
  • Loading branch information
Tyler Smalley committed Jun 15, 2020
1 parent 86aa4f2 commit 84e02fc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { TypeOf } from '@kbn/config-schema';
import { RequestHandler, Logger } from 'kibana/server';
import { validateAlerts } from '../../../../common/endpoint/schema/resolver';
import { eventsIndexPattern } from '../../../../common/endpoint/constants';
import { Fetcher } from './utils/fetch';
import { EndpointAppContext } from '../../types';

Expand All @@ -21,9 +20,11 @@ export function handleAlerts(
query: { alerts, afterAlert, legacyEndpointID: endpointID },
} = req;
try {
const indexRetriever = endpointAppContext.service.getIndexPatternRetriever();
const client = context.core.elasticsearch.legacy.client;
const indexPattern = await indexRetriever.getEventIndexPattern(context);

const fetcher = new Fetcher(client, id, eventsIndexPattern, endpointID);
const fetcher = new Fetcher(client, id, indexPattern, endpointID);

return res.ok({
body: await fetcher.alerts(alerts, afterAlert),
Expand Down

0 comments on commit 84e02fc

Please sign in to comment.