mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Using correct index patterns (#69208)
This commit is contained in:
parent
ecd3c9b517
commit
4f5e279d75
1 changed files with 2 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
|||
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';
|
||||
|
||||
|
@ -20,11 +21,9 @@ 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, indexPattern, endpointID);
|
||||
const fetcher = new Fetcher(client, id, eventsIndexPattern, endpointID);
|
||||
|
||||
return res.ok({
|
||||
body: await fetcher.alerts(alerts, afterAlert),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue