Skip to content

Commit

Permalink
EQL: Introduce repeatable queries (#75082) (#78450)
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.

(cherry picked from commit c7ef3a6)
  • Loading branch information
costin authored Sep 29, 2021
1 parent 9381fc6 commit 26ec45a
Show file tree
Hide file tree
Showing 8 changed files with 631 additions and 309 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 26ec45a

Please sign in to comment.