From 809cf842ab54eb60437a896dd31ecdec11492710 Mon Sep 17 00:00:00 2001 From: To-om Date: Thu, 9 Jul 2020 14:16:59 +0200 Subject: [PATCH] #1427 Include ioc count in observable count in alert similarities --- thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala index 6ef6a51c59..aeb9161c02 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala @@ -142,7 +142,7 @@ class AlertCtrl @Inject() ( val similarCase = case0 .asInstanceOf[Case] .into[OutputSimilarCase] - .withFieldConst(_.artifactCount, observableCount.getOrDefault(false, 0L).toInt) + .withFieldConst(_.artifactCount, observableCount.asScala.values.map(_.toLong).sum) .withFieldConst(_.iocCount, observableCount.getOrDefault(true, 0L).toInt) .withFieldConst(_.similarArtifactCount, iocStats.values.sum) .withFieldConst(_.similarIOCCount, iocStats.getOrElse(true, 0))