From 0e65cf7ae2feb193e859494a283cb48673721382 Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Sun, 14 Oct 2018 20:37:57 -0400 Subject: [PATCH] Fix existring sample lookup --- parsedmarc/elastic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parsedmarc/elastic.py b/parsedmarc/elastic.py index 3ea65ed..0957458 100644 --- a/parsedmarc/elastic.py +++ b/parsedmarc/elastic.py @@ -329,7 +329,7 @@ def save_forensic_report_to_elasticsearch(forensic_report, if "from" in headers: from_ = headers["from"] from_query = {"match": {"sample.headers.from": from_}} - q = q & from_query + q = q & Q(from_query) if "to" in headers: to_ = headers["to"] to_query = {"match": {"sample.headers.to": to_}} @@ -337,7 +337,7 @@ def save_forensic_report_to_elasticsearch(forensic_report, if "subject" in headers: subject = headers["subject"] subject_query = {"match": {"sample.headers.subject": subject}} - q = q & subject_query + q = q & Q(subject_query) search.query = q existing = search.execute()