From f3c1c4492a2529b906d747e19b853c44c97c8b63 Mon Sep 17 00:00:00 2001 From: Alberto Dainotti Date: Thu, 12 Mar 2026 20:42:21 -0400 Subject: [PATCH] feat: add labels query parameter to filter events by inference label --- app/elastic.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/elastic.py b/app/elastic.py index 53d40bf..b6cf1b7 100644 --- a/app/elastic.py +++ b/app/elastic.py @@ -237,6 +237,12 @@ def buildESEventQuery(queryparams): add_match_params(must_terms, must_not_terms, "summary.inference_result.inferences.inference_id", codestring); + labelstring = queryparams.get('labels', type=str) + if labelstring is not None: + add_match_params(must_terms, must_not_terms, + "summary.inference_result.primary_inference.labels", + labelstring) + return { 'query': { 'bool': {