[Endpoint] Unifying the test index name for resolver and alerts (#59073)

* Unifying the test index name for resolver and alerts

* Endpoint isn't sending the agent field so check for it

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Jonathan Buttner 2020-03-06 09:43:52 -05:00 committed by GitHub
parent 4977e57a3e
commit 2e41a27c46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View file

@ -31,9 +31,9 @@ export enum Direction {
export class EndpointAppConstants {
static BASE_API_URL = '/api/endpoint';
static ALERT_INDEX_NAME = 'my-index';
static ENDPOINT_INDEX_NAME = 'endpoint-agent*';
static EVENT_INDEX_NAME = 'endpoint-events-*';
static ALERT_INDEX_NAME = 'events-endpoint-1';
static EVENT_INDEX_NAME = 'events-endpoint-*';
static DEFAULT_TOTAL_HITS = 10000;
/**
* Legacy events are stored in indices with endgame-* prefix

View file

@ -7,7 +7,7 @@
import { ResolverEvent, LegacyEndpointEvent } from '../../../../common/types';
function isLegacyData(data: ResolverEvent): data is LegacyEndpointEvent {
return data.agent.type === 'endgame';
return data.agent?.type === 'endgame';
}
export function extractEventID(event: ResolverEvent) {

View file

@ -3,7 +3,7 @@
"value": {
"aliases": {
},
"index": "my-index",
"index": "events-endpoint-1",
"mappings": {
"_meta": {
"version": "1.5.0-dev"
@ -5262,4 +5262,4 @@
}
}
}
}
}