File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ class SplunkBackend(TextQueryBackend):
157
157
field_in_list_expression : ClassVar [str ] = "{field} {op} ({list})"
158
158
or_in_operator : ClassVar [Optional [str ]] = "IN"
159
159
list_separator : ClassVar [str ] = ", "
160
+ field_exists_expression : ClassVar [str ] = "{field}=*"
161
+ field_not_exists_expression : ClassVar [str ] = "NOT {field}=*"
160
162
161
163
unbound_value_str_expression : ClassVar [str ] = "{value}"
162
164
unbound_value_num_expression : ClassVar [str ] = "{value}"
Original file line number Diff line number Diff line change @@ -376,6 +376,27 @@ def test_splunk_fieldref_or(splunk_backend: SplunkBackend):
376
376
)
377
377
)
378
378
379
+ def test_splunk_exists (splunk_backend : SplunkBackend ):
380
+ assert (
381
+ splunk_backend .convert (
382
+ SigmaCollection .from_yaml (
383
+ """
384
+ title: Test
385
+ status: test
386
+ logsource:
387
+ category: test_category
388
+ product: test_product
389
+ detection:
390
+ sel:
391
+ fieldA|exists: yes
392
+ fieldB|exists: no
393
+ condition: sel
394
+ """
395
+ )
396
+ )
397
+ == ['fieldA=* NOT fieldB=*' ]
398
+ )
399
+
379
400
380
401
def test_splunk_fields_output (splunk_backend : SplunkBackend ):
381
402
rule = SigmaCollection .from_yaml (
You can’t perform that action at this time.
0 commit comments