From 2101dee91069744f320f891abe433b2681fcaeaa Mon Sep 17 00:00:00 2001 From: elhoim Date: Thu, 17 Sep 2026 08:22:07 +0000 Subject: [PATCH] Fix --dump in correlator.py The --dump branch applied .format(h) to the Redis result instead of the key, so it queried the literal key '{}:eids' and then called .format on the returned set, raising AttributeError on the first hash. Build the key the same way line 86 does when writing it. The following line also concatenated a list with the set returned by smembers, raising TypeError. Sort the event IDs into a list so writerow receives one sequence and the CSV output is deterministic. Both defects were on the same path, so --dump had never worked. Co-Authored-By: Claude Opus 5 (1M context) --- grouping/correlator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grouping/correlator.py b/grouping/correlator.py index 8038bae..ba4b612 100755 --- a/grouping/correlator.py +++ b/grouping/correlator.py @@ -94,6 +94,6 @@ def search_misp_values(r, values, return_eventid=True): writer = csv.writer(sys.stdout) all_hashes = r.smembers('hashes_md5').union(r.smembers('hashes_sha1')).union(r.smembers('hashes_sha256')) for h in all_hashes: - eids = r.smembers('{}:eids').format(h) + eids = r.smembers('{}:eids'.format(h)) if eids: - writer.writerow([h] + eids) + writer.writerow([h] + sorted(eids))