Skip to content

Commit

Permalink
[Security Solution][Detections][Threshold Rules] Add `threshold_resul…
Browse files Browse the repository at this point in the history
…t` to alert notification context (elastic#95354)

* Don't remove threshold_result from _source prematurely

* Fix type error

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts
  • Loading branch information
madirey committed Apr 6, 2021
1 parent fde0fe3 commit 61d8f62
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 61d8f62

Please sign in to comment.