Skip to content

Commit

Permalink
EQL: Introduce repeatable queries (#75082)
Browse files Browse the repository at this point in the history
Allow individual queries within a sequence to be ran multiple times
through using the [runs=number] construct as a suffix without 
having to redeclare the query.

sequence
  queryA [runs=2]
  queryB
  queryC [runs=3]
  queryD

is the same as:

sequence
  queryA
  queryA
  queryB
  queryC
  queryC
  queryC
  queryD

but more concise.
  • Loading branch information
costin authored Sep 29, 2021
1 parent f8c43ad commit c7ef3a6
Show file tree
Hide file tree
Showing 8 changed files with 634 additions and 311 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,35 @@ sequence by unique_pid
[any where true]
[any where serial_event_id < 72]
'''
expected_event_ids = [
54, 55, 59,
55, 59, 61,
59, 61, 65,
16, 60, 66,
61, 65, 67,
65, 67, 70,
60, 66, 71]
expected_event_ids = [
54, 55, 59,
55, 59, 61,
59, 61, 65,
16, 60, 66,
61, 65, 67,
65, 67, 70,
60, 66, 71]

[[queries]]
name = "sequenceWithMoreThan10Results-Runs"
query = '''
sequence by unique_pid
[any where true] [runs=2]
[any where serial_event_id < 72]
'''
expected_event_ids = [
54, 55, 59,
55, 59, 61,
59, 61, 65,
16, 60, 66,
61, 65, 67,
65, 67, 70,
60, 66, 71]

[[queries]]
name = "seqSingleArg"
query = 'process where string(serial_event_id) : ("1")'
expected_event_ids = [1]
expected_event_ids = [1]

[[queries]]
name = "seqSingleArgPattern"
Expand Down
Loading

0 comments on commit c7ef3a6

Please sign in to comment.