From 15e7bfae61a4f05d2513970c04016f2dd1de4aa4 Mon Sep 17 00:00:00 2001 From: TimDiam0nd <54599998+TimDiam0nd@users.noreply.github.com> Date: Thu, 29 Aug 2024 08:28:46 +0100 Subject: [PATCH] Remove json whitespace in ingest() Update ingest function so that JSON objects contain no whitespace between colons and commas, to reduce body size and also make raw log searching json easier --- common/ingest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/ingest.py b/common/ingest.py index ba239ff..03996fd 100644 --- a/common/ingest.py +++ b/common/ingest.py @@ -94,7 +94,7 @@ def ingest(data: list[Any], log_type: str): # [{"logText": str(log1)}, {"logText": str(log2)}, ...] parsed_data = list( map( - lambda i: {"logText": str(json.dumps(i).encode("utf-8"), "utf-8")}, + lambda i: {"logText": str(json.dumps(i, separators=(',', ':')).encode("utf-8"), "utf-8")}, data, ) )