From f72b23fefd82926eb46696dbc01d942497754cdb Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Mon, 1 Mar 2021 11:56:49 -0600 Subject: [PATCH] text fixing --- .../timeline/factory/events/all/helpers.test.ts | 4 ++-- .../timeline/factory/events/all/helpers.ts | 2 +- .../apis/security_solution/timeline_details.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.test.ts b/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.test.ts index dc44c677ac78dd..61af6a7664faa6 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.test.ts @@ -99,7 +99,7 @@ describe('#formatTimelineData', () => { }); }); - it('rule signal results', () => { + it('rule signal results', async () => { const response: EventHit = { _index: '.siem-signals-patrykkopycinski-default-000007', _id: 'a77040f198355793c35bf22b900902371309be615381f0a2ec92c208b6132562', @@ -267,7 +267,7 @@ describe('#formatTimelineData', () => { }; expect( - formatTimelineData( + await formatTimelineData( ['@timestamp', 'host.name', 'destination.ip', 'source.ip'], TIMELINE_EVENTS_FIELDS, response diff --git a/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.ts index 8e0c84fb7d4137..e5bb8cb7e14b73 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.ts @@ -108,7 +108,7 @@ const mergeTimelineFieldsWithHit = async ( ) => { if (fieldName != null || dataFields.includes(fieldName)) { const fieldNameAsArray = fieldName.split('.'); - const nestedParentFieldName = Object.keys(hit.fields).find((f) => { + const nestedParentFieldName = Object.keys(hit.fields ?? []).find((f) => { return f === fieldNameAsArray.slice(0, f.split('.').length).join('.'); }); if ( diff --git a/x-pack/test/api_integration/apis/security_solution/timeline_details.ts b/x-pack/test/api_integration/apis/security_solution/timeline_details.ts index c5afb67321aafb..d653528fd47e26 100644 --- a/x-pack/test/api_integration/apis/security_solution/timeline_details.ts +++ b/x-pack/test/api_integration/apis/security_solution/timeline_details.ts @@ -379,8 +379,8 @@ const EXPECTED_DATA = [ { category: 'source', field: 'source.geo.location', - values: ['{"long":-122.3341,"lat":47.6103}'], - originalValue: ['{"coordinates":[-122.3341,47.6103],"type":"Point"}'], + values: ['{"lon":-122.3341,"lat":47.6103}'], + originalValue: ['{"lon":-122.3341,"lat":47.6103}'], isObjectArray: true, }, { @@ -611,8 +611,8 @@ const EXPECTED_DATA = [ { category: 'traefik', field: 'traefik.access.geoip.location', - values: ['{"long":-122.3341,"lat":47.6103}'], - originalValue: ['{"coordinates":[-122.3341,47.6103],"type":"Point"}'], + values: ['{"lon":-122.3341,"lat":47.6103}'], + originalValue: ['{"lon":-122.3341,"lat":47.6103}'], isObjectArray: true, }, {