Repository navigation
Feat/improve data model conversion - #76
Merged
thomaspatzke merged 6 commits intoSep 19, 2026
Merged
Conversation
scripton8
marked this pull request as ready for review
September 9, 2026 13:01
Member
|
Nice one, I totally like this 😉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splunk backend: configurable data model (
tstats) query settingsBranch:
feat/improve-data-model-conversionProblem
The
data_modeloutput format emitted a fixedtstatsquery. Everything aftercount min(_time)... max(_time)...was hardcoded, so the accelerated query could not beadapted to an environment without patching the backend or post-processing its output:
summariesonly=falsewas hardcoded — no way to forcesummariesonly=true(accelerated-data-only) per environment.
countwas produced — no way to addvalues(...),dc(...),sum(...), etc._timewith aspan=.Fix
Added opt-in settings read from the pipeline processing state (
set_state), plus asummariesonlybackend option. Defaults keep the generated query byte-for-byteidentical, so existing behaviour is unchanged. All inputs are validated (allow-listed
functions, regex-checked identifiers/spans) to prevent SPL injection.
summariesonlyset_statetstats summariesonly=...tstats_spanset_state_timetoby+span=<value>tstats_aggregationsset_statecounttstats_aggregationset_stateExamples
Default (unchanged)
summariesonlyBackend option (also
-O summariesonly=truewith sigma-cli):Or via pipeline (pipeline state takes precedence over the backend option):
Result:
tstats_aggregations(structured, appended aftercount)Result:
tstats_aggregation(raw string, advanced — overrides the structured list)Result:
tstats_span(time bucketing)Result (
_timeadded toby,span=appended):Validation & safety
summariesonly: accepts a bool or a string (true/false/yes/no/1/0);anything else raises
SigmaFeatureNotSupportedByBackendError.tstats_aggregations:funcmust be in an allow-list of Splunk stats functions(
avg,dc,sum,values,min,max,latest,per_hour, ...);countisintentionally excluded (always present and cannot be redefined);
fieldand aliasmust match
^[\w.]+$; a missingfieldraises.tstats_span: must match^\d+(?:s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours|d|day|days|mon|mont|months)?$.Closes #75
@thomaspatzke not sure if this is a solution you like, but I give it a try^^