Skip to content

Commit

Permalink
[7.x] [Endpoint] Unifying the test index name for resolver and… (#60587)
Browse files Browse the repository at this point in the history
* 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>

Co-authored-by: Jonathan Buttner <56361221+jonathan-buttner@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 19, 2020
1 parent f056b1a commit dfea6de
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/endpoint/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export type Direction = 'asc' | 'desc';

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"value": {
"aliases": {
},
"index": "my-index",
"index": "events-endpoint-1",
"mappings": {
"_meta": {
"version": "1.5.0-dev"
Expand Down Expand Up @@ -5262,4 +5262,4 @@
}
}
}
}
}

0 comments on commit dfea6de

Please sign in to comment.