From b5abefe797d5fbeba65a0e1152dd1603941976f6 Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Sat, 17 Jan 2026 19:44:21 -0500 Subject: [PATCH] feat: add result collection debug logging Add debug output before each result fetch showing: - Current offset position - Configured limit (page size) - Total events collected so far This provides visibility into the result collection loop when troubleshooting search behavior. Output uses distinct sourcetype 'goatsearch:debug' for easy filtering. Zero overhead when debug=False. --- bin/goatsearch.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/goatsearch.py b/bin/goatsearch.py index 0997764..279cbc8 100644 --- a/bin/goatsearch.py +++ b/bin/goatsearch.py @@ -354,6 +354,15 @@ def generate(self): # TODO: We have to account for the fact these results may be out of time-order. + if self.debug: + yield { + "_raw": json.dumps({"url": results_uri}), + "_time": time.time(), + "source": "goatsearch", + "sourcetype": "goatsearch:debug", + "host": "localhost" + } + self.headers['Accept'] = 'application/x-nd-json' results_chunk = requests.get(