diff --git a/package.json b/package.json index 8ebd1a3ec9890..408d97c7908ec 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ }, "dependencies": { "@elastic/datemath": "link:packages/elastic-datemath", - "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^7.12.0-canary.6", + "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^7.12.0-canary.7", "@elastic/ems-client": "7.12.0", "@elastic/eui": "31.7.0", "@elastic/filesaver": "1.1.2", diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts index fb72bf9c59b4e..f191d4b5b6843 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts @@ -73,10 +73,12 @@ export const buildBulkBody = ({ ...buildSignal([doc], rule), ...additionalSignalFields(doc), }; - delete doc._source.threshold_result; const event = buildEventTypeSignal(doc); + const { threshold_result: thresholdResult, ...filteredSource } = doc._source || { + threshold_result: null, + }; const signalHit: SignalHit = { - ...doc._source, + ...filteredSource, '@timestamp': new Date().toISOString(), event, signal, diff --git a/yarn.lock b/yarn.lock index 034cb2c424321..ee3656eaea2c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2167,10 +2167,10 @@ version "0.0.0" uid "" -"@elastic/elasticsearch@npm:@elastic/elasticsearch-canary@^7.12.0-canary.6": - version "7.12.0-canary.6" - resolved "https://registry.yarnpkg.com/@elastic/elasticsearch-canary/-/elasticsearch-canary-7.12.0-canary.6.tgz#65a9ad7dbc372e39a2925ee2eaea98fb9996fa0c" - integrity sha512-2mEU66wG07iRg8ONMFKYvliaepZSReHT2x2Pd541TEtFoKXw+2m6Btdu6em+wEgxRlWSGdVh4ZFk5f2TR8AhbQ== +"@elastic/elasticsearch@npm:@elastic/elasticsearch-canary@^7.12.0-canary.7": + version "7.12.0-canary.7" + resolved "https://registry.yarnpkg.com/@elastic/elasticsearch-canary/-/elasticsearch-canary-7.12.0-canary.7.tgz#4ee0c2c1be6e842357a3e68566cff543f58b0d38" + integrity sha512-ZS27nBGr9RlGGPp7lIG4cwMu/eaEqwucrWX1+EqvO0eAYocxdzkgkExabW81u7Zc7DK9n3nIuAGdV9WowvzZdQ== dependencies: debug "^4.3.1" hpagent "^0.1.1"