Skip to content

CX-159018: Template Time Chunking#96

Open
arvyncabrera wants to merge 3 commits intosecureworks:mainfrom
arvyncabrera:template_chunking
Open

CX-159018: Template Time Chunking#96
arvyncabrera wants to merge 3 commits intosecureworks:mainfrom
arvyncabrera:template_chunking

Conversation

@arvyncabrera
Copy link
Copy Markdown
Contributor

Issue #95: Template Time Chunking

This PR closes issue #95

Description:
This change adds chunked time-range search support for Jinja2 template queries. Using | earliest or | latest with a list of Taegis relative timestamps alongside the -t flag triggers this logic.

The pull request adds filters.py, time_range.py, and chunked_search.py to the core service. Since the chunking logic was a bit complex, I didn't want to toss all of those functions on templates/init.py. However, I can move the change there if needed.

magics.py is updated with a conditional statement for chunked calls + filter imports. It should only the chunk logic if chunking is detected.

taegis_search_results.md.jinja is also modified with a conditional statement to display all chunked executions + their sharelinks, with a final total of all results at the end.

Sample test case (this will fall back onto doing three (3) 30d searches as the highest is three months, because Taegis events cannot search above 30days)

%%taegis events search --tenant 149369 --region delta --assign results -t
from detectionfinding where @raw contains 'CREDS'
{{ ['-3mo', '-60d', '-30d'] | earliest }}

@arvyncabrera arvyncabrera marked this pull request as draft April 9, 2026 20:13
Signed-off-by: arvyncabrera <arvyn.cabrera@sophos.com>
…pings from unit map.

Signed-off-by: arvyncabrera <arvyn.cabrera@sophos.com>
…nd execution) and filters.py (for parsing of template filters.).

modified taegis_search_results.md.jinja to include chunk results per run if it chunk_results is defined.

magics.py modified to register earliest and latest filters alongside SDK.. then a conditional statement to execute chunked searches when a chunking schedule is detected

Signed-off-by: arvyncabrera <arvyn.cabrera@sophos.com>
@arvyncabrera arvyncabrera marked this pull request as ready for review April 9, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant