File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
x-pack/legacy/plugins/siem/server/lib/detection_engine/signals Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 44 * you may not use this file except in compliance with the Elastic License.
55 */
66
7- import { countBy } from 'lodash' ;
7+ import { countBy , isEmpty } from 'lodash' ;
88import { performance } from 'perf_hooks' ;
99import { AlertServices } from '../../../../../alerting/server/types' ;
1010import { SignalSearchResponse , BulkResponse } from './types' ;
@@ -82,9 +82,9 @@ export const singleBulkCreate = async ({
8282 if ( response . errors ) {
8383 const itemsWithErrors = response . items . filter ( item => item . create . error ) ;
8484 const errorCountsByStatus = countBy ( itemsWithErrors , item => item . create . status ) ;
85- const hasNonDuplicateError = Object . keys ( errorCountsByStatus ) . some ( status => status !== '409' ) ;
85+ delete errorCountsByStatus [ '409' ] ; // Duplicate signals are expected
8686
87- if ( hasNonDuplicateError ) {
87+ if ( ! isEmpty ( errorCountsByStatus ) ) {
8888 logger . error (
8989 `[-] bulkResponse had errors with response statuses:counts of...\n${ JSON . stringify (
9090 errorCountsByStatus ,
You can’t perform that action at this time.
0 commit comments