diff --git a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/BaseEqlSpecTestCase.java b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/BaseEqlSpecTestCase.java
index d774539ec03..798eb868659 100644
--- a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/BaseEqlSpecTestCase.java
+++ b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/BaseEqlSpecTestCase.java
@@ -32,7 +32,7 @@ import static java.util.stream.Collectors.toList;
public abstract class BaseEqlSpecTestCase extends ESRestTestCase {
- protected static final String PARAM_FORMATTING = "%1$s.test -> %2$s";
+ protected static final String PARAM_FORMATTING = "%2$s";
private RestHighLevelClient highLevelClient;
diff --git a/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml b/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml
index 2ffc81eed9c..6647eb13ea3 100644
--- a/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml
+++ b/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml
@@ -5,14 +5,14 @@
name = "betweenAdditional1"
expected_event_ids = [95]
query = '''
-file where between(file_path, "dev", ".json", false) == "\\TestLogs\\something"
+file where between(file_path, "dev", ".json", false) : "\\TestLogs\\something"
'''
[[queries]]
name = "betweenAdditional2"
expected_event_ids = [95]
query = '''
-file where between(file_path, "dev", ".json", true) == "\\TestLogs\\something"
+file where between(file_path, "dev", ".json", true) : "\\TestLogs\\something"
'''
[[queries]]
@@ -26,7 +26,7 @@ network where cidrMatch(source_address, "10.6.48.157/8") == true
name = "stringCidrMatch2"
expected_event_ids = [75304, 75305]
query = '''
-network where string(cidrMatch(source_address, "10.6.48.157/8")) == "true"
+network where string(cidrMatch(source_address, "10.6.48.157/8")) : "true"
'''
[[queries]]
@@ -62,14 +62,14 @@ network where cidrMatch(source_address, "0.0.0.0/0") == true
name = "concatEquals1"
description = "test string concatenation. update test to avoid case-sensitivity issues"
query = '''
-process where concat(serial_event_id, "::", process_name, "::", opcode) == "5::wininit.exe::3"
+process where concat(serial_event_id, "::", process_name, "::", opcode) : "5::wininit.exe::3"
'''
expected_event_ids = [5]
[[queries]]
name = "concatEquals2"
-query = 'process where concat(serial_event_id) == "1"'
+query = 'process where concat(serial_event_id) : "1"'
expected_event_ids = [1]
[[queries]]
@@ -98,7 +98,7 @@ expected_event_ids = [1, 2, 3, 4]
[[queries]]
name = "numberStringConversion1"
-query = 'process where string(serial_event_id) == "1"'
+query = 'process where string(serial_event_id) : "1"'
expected_event_ids = [1]
diff --git a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml
index c57ffb9dfe5..86c7da35654 100644
--- a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml
+++ b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml
@@ -31,7 +31,7 @@ query = 'process where bad_field == null | head 5'
[[queries]]
name = "processNameInexistent"
query = '''
-process where process_name == "impossible name" or (serial_event_id < 4.5 and serial_event_id >= 3.1)
+process where process_name : "impossible name" or (serial_event_id < 4.5 and serial_event_id >= 3.1)
'''
expected_event_ids = [4]
@@ -253,7 +253,7 @@ expected_event_ids = [1, 2]
name = "processWithStringEqualityCaseInsensitive1"
case_insensitive = true
query = '''
-process where process_name == "VMACTHLP.exe" and unique_pid == 12
+process where process_name : "VMACTHLP.exe" and unique_pid == 12
| filter true
'''
expected_event_ids = [12]
@@ -351,47 +351,47 @@ name = "lengthCaseInsensitive1"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where length(bytes_written_string_list) == 2 and bytes_written_string_list[1] == "EN"
+registry where length(bytes_written_string_list) == 2 and bytes_written_string_list[1] : "EN"
'''
[[queries]]
name = "keyPathWildcard"
query = '''
-registry where key_path == "*\\MACHINE\\SAM\\SAM\\*\\Account\\Us*ers\\00*03E9\\F"
+registry where key_path : "*\\MACHINE\\SAM\\SAM\\*\\Account\\Us*ers\\00*03E9\\F"
'''
expected_event_ids = [79]
[[queries]]
name = "processPathWildcardAndIN"
query = '''
-process where process_path == "*\\red_ttp\\wininit.*" and opcode in (0,1,2,3,4)
+process where process_path : "*\\red_ttp\\wininit.*" and opcode in (0,1,2,3,4)
'''
expected_event_ids = [84, 85]
[[queries]]
name = "descendant1"
query = '''
-file where file_name == "csrss.exe" and opcode==0
- and descendant of [process where opcode in (1,3) and process_name=="cmd.exe"]
+file where file_name : "csrss.exe" and opcode==0
+ and descendant of [process where opcode in (1,3) and process_name:"cmd.exe"]
'''
expected_event_ids = [72]
[[queries]]
name = "descendant2"
query = '''
-process where opcode==1 and process_name == "csrss.exe"
- and descendant of [file where file_name == "csrss.exe" and opcode==0]
+process where opcode==1 and process_name : "csrss.exe"
+ and descendant of [file where file_name : "csrss.exe" and opcode==0]
'''
expected_event_ids = [73]
[[queries]]
name = "descendant3"
query = '''
-process where opcode==1 and process_name == "smss.exe"
+process where opcode==1 and process_name : "smss.exe"
and descendant of [
- file where file_name == "csrss.exe" and opcode==0
+ file where file_name : "csrss.exe" and opcode==0
and descendant of [
- process where opcode in(1,3) and process_name=="cmd.exe"
+ process where opcode in(1,3) and process_name:"cmd.exe"
]
]
'''
@@ -400,24 +400,24 @@ expected_event_ids = [78]
[[queries]]
name = "wildcardAndMultipleConditions1"
query = '''
-file where file_path=="*\\red_ttp\\winin*.*"
- and opcode in (0,1,2) and user_name=="vagrant"
+file where file_path:"*\\red_ttp\\winin*.*"
+ and opcode in (0,1,2) and user_name:"vagrant"
'''
expected_event_ids = [83, 86]
[[queries]]
name = "wildcardAndMultipleConditions2"
query = '''
-file where file_path=="*\\red_ttp\\winin*.*"
- and opcode not in (0,1,2) and user_name=="vagrant"
+file where file_path:"*\\red_ttp\\winin*.*"
+ and opcode not in (0,1,2) and user_name:"vagrant"
'''
expected_event_ids = []
[[queries]]
name = "wildcardAndMultipleConditions3"
query = '''
-file where file_path=="*\\red_ttp\\winin*.*"
- and opcode not in (3, 4, 5, 6 ,7) and user_name=="vagrant"
+file where file_path:"*\\red_ttp\\winin*.*"
+ and opcode not in (3, 4, 5, 6 ,7) and user_name:"vagrant"
'''
expected_event_ids = [83, 86]
@@ -762,7 +762,7 @@ expected_event_ids = [1, 2,
name = "sequencesOnDifferentEventTypes1"
query = '''
sequence by unique_pid
- [process where opcode==1 and process_name == "MSBuild.exe"]
+ [process where opcode==1 and process_name : "MSBuild.exe"]
[network where true]
'''
expected_event_ids = [75273, 75304]
@@ -773,10 +773,10 @@ description = "test that process sequences are working correctly"
name = "sequencesOnDifferentEventTypes2"
query = '''
sequence
- [file where event_subtype_full == "file_create_event"] by file_path
+ [file where event_subtype_full : "file_create_event"] by file_path
[process where opcode == 1] by process_path
[process where opcode == 2] by process_path
- [file where event_subtype_full == "file_delete_event"] by file_path
+ [file where event_subtype_full : "file_delete_event"] by file_path
| head 4
| tail 2
'''
@@ -787,10 +787,10 @@ expected_event_ids = [67, 68, 69, 70,
name = "sequencesOnDifferentEventTypes3"
query = '''
sequence with maxspan=1d
- [file where event_subtype_full == "file_create_event"] by file_path
+ [file where event_subtype_full : "file_create_event"] by file_path
[process where opcode == 1] by process_path
[process where opcode == 2] by process_path
- [file where event_subtype_full == "file_delete_event"] by file_path
+ [file where event_subtype_full : "file_delete_event"] by file_path
| head 4
| tail 2
'''
@@ -801,10 +801,10 @@ expected_event_ids = [67, 68, 69, 70,
name = "sequencesOnDifferentEventTypes4"
query = '''
sequence with maxspan=1h
- [file where event_subtype_full == "file_create_event"] by file_path
+ [file where event_subtype_full : "file_create_event"] by file_path
[process where opcode == 1] by process_path
[process where opcode == 2] by process_path
- [file where event_subtype_full == "file_delete_event"] by file_path
+ [file where event_subtype_full : "file_delete_event"] by file_path
| head 4
| tail 2
'''
@@ -815,10 +815,10 @@ expected_event_ids = [67, 68, 69, 70,
name = "sequencesOnDifferentEventTypes5"
query = '''
sequence with maxspan=1m
- [file where event_subtype_full == "file_create_event"] by file_path
+ [file where event_subtype_full : "file_create_event"] by file_path
[process where opcode == 1] by process_path
[process where opcode == 2] by process_path
- [file where event_subtype_full == "file_delete_event"] by file_path
+ [file where event_subtype_full : "file_delete_event"] by file_path
| head 4
| tail 2
'''
@@ -829,10 +829,10 @@ expected_event_ids = [67, 68, 69, 70,
name = "sequencesOnDifferentEventTypes6"
query = '''
sequence with maxspan=10s
- [file where event_subtype_full == "file_create_event"] by file_path
+ [file where event_subtype_full : "file_create_event"] by file_path
[process where opcode == 1] by process_path
[process where opcode == 2] by process_path
- [file where event_subtype_full == "file_delete_event"] by file_path
+ [file where event_subtype_full : "file_delete_event"] by file_path
| head 4
| tail 2
'''
@@ -843,10 +843,10 @@ expected_event_ids = [67, 68, 69, 70,
name = "sequencesOnDifferentEventTypes7"
query = '''
sequence with maxspan=500ms
- [file where event_subtype_full == "file_create_event"] by file_path
+ [file where event_subtype_full : "file_create_event"] by file_path
[process where opcode == 1] by process_path
[process where opcode == 2] by process_path
- [file where event_subtype_full == "file_delete_event"] by file_path
+ [file where event_subtype_full : "file_delete_event"] by file_path
| head 4
| tail 2
'''
@@ -867,7 +867,7 @@ expected_event_ids = [1, 2,
name = "sequencesOnDifferentEventTypesWithBy"
query = '''
sequence
- [file where opcode==0 and file_name=="svchost.exe"] by unique_pid
+ [file where opcode==0 and file_name:"svchost.exe"] by unique_pid
[process where opcode == 1] by unique_ppid
'''
expected_event_ids = [55, 56]
@@ -896,8 +896,8 @@ expected_event_ids = [87, 92]
name = "doubleSameSequenceWithByUntilAndHead1"
query = '''
sequence
- [file where opcode==0 and file_name=="*.exe"] by unique_pid
- [file where opcode==0 and file_name=="*.exe"] by unique_pid
+ [file where opcode==0 and file_name:"*.exe"] by unique_pid
+ [file where opcode==0 and file_name:"*.exe"] by unique_pid
until [process where opcode==5000] by unique_ppid
| head 1
'''
@@ -907,8 +907,8 @@ expected_event_ids = [55, 61]
name = "doubleSameSequenceWithByUntilAndHead2"
query = '''
sequence
- [file where opcode==0 and file_name=="*.exe"] by unique_pid
- [file where opcode==0 and file_name=="*.exe"] by unique_pid
+ [file where opcode==0 and file_name:"*.exe"] by unique_pid
+ [file where opcode==0 and file_name:"*.exe"] by unique_pid
until [process where opcode==1] by unique_ppid
| head 1
'''
@@ -918,8 +918,8 @@ expected_event_ids = []
name = "doubleJoinWithByUntilAndHead"
query = '''
join
- [file where opcode==0 and file_name=="*.exe"] by unique_pid
- [file where opcode==2 and file_name=="*.exe"] by unique_pid
+ [file where opcode==0 and file_name:"*.exe"] by unique_pid
+ [file where opcode==2 and file_name:"*.exe"] by unique_pid
until [process where opcode==1] by unique_ppid
| head 1
'''
@@ -929,8 +929,8 @@ expected_event_ids = [61, 59]
name = "twoJoins1"
query = '''
join by user_name
- [process where opcode in (1,3) and process_name=="smss.exe"]
- [process where opcode in (1,3) and process_name == "python.exe"]
+ [process where opcode in (1,3) and process_name:"smss.exe"]
+ [process where opcode in (1,3) and process_name : "python.exe"]
'''
expected_event_ids = [78, 48]
@@ -939,8 +939,8 @@ name = "threeJoins1"
query = '''
join by unique_pid
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
'''
expected_event_ids = [54, 55, 61]
@@ -949,8 +949,8 @@ name = "threeJoins2"
query = '''
join by string(unique_pid)
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
'''
expected_event_ids = [54, 55, 61]
@@ -959,8 +959,8 @@ name = "threeJoinsWithUntil1"
query = '''
join by unique_pid
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
until [file where opcode == 2]
'''
expected_event_ids = []
@@ -970,8 +970,8 @@ name = "threeJoinsWithUntil2"
query = '''
join by string(unique_pid), unique_pid, unique_pid * 2
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
until [file where opcode == 2]
'''
expected_event_ids = []
@@ -980,7 +980,7 @@ expected_event_ids = []
name = "twoJoins2"
query = '''
join
- [file where opcode==0 and file_name=="svchost.exe"] by unique_pid
+ [file where opcode==0 and file_name:"svchost.exe"] by unique_pid
[process where opcode == 1] by unique_ppid
'''
expected_event_ids = [55, 56]
@@ -989,8 +989,8 @@ expected_event_ids = [55, 56]
name = "twoJoins3"
query = '''
join by unique_pid
- [process where opcode in (1,3) and process_name=="python.exe"]
- [file where file_name == "*.exe"]
+ [process where opcode in (1,3) and process_name:"python.exe"]
+ [file where file_name : "*.exe"]
'''
expected_event_ids = [54, 55]
@@ -998,8 +998,8 @@ expected_event_ids = [54, 55]
name = "twoJoins4"
query = '''
join by user_name
- [process where opcode in (1,3) and process_name=="python.exe"]
- [process where opcode in (1,3) and process_name == "smss.exe"]
+ [process where opcode in (1,3) and process_name:"python.exe"]
+ [process where opcode in (1,3) and process_name : "smss.exe"]
'''
expected_event_ids = [48, 78]
@@ -1007,8 +1007,8 @@ expected_event_ids = [48, 78]
name = "twoJoins5"
query = '''
join
- [process where opcode in (1,3) and process_name=="python.exe"]
- [process where opcode in (1,3) and process_name == "smss.exe"]
+ [process where opcode in (1,3) and process_name:"python.exe"]
+ [process where opcode in (1,3) and process_name : "smss.exe"]
'''
expected_event_ids = [48, 3, 50, 78]
@@ -1016,7 +1016,7 @@ expected_event_ids = [48, 3, 50, 78]
name = "fakeField"
expected_event_ids = []
query = '''
-process where fake_field == "*"
+process where fake_field : "*"
'''
[[queries]]
@@ -1033,7 +1033,7 @@ expected_event_ids = []
[[queries]]
name = "fakeFieldWithHead2"
query = '''
-process where not (fake_field == "*")
+process where not (fake_field : "*")
| head 4
'''
# no longer valid, since this returns `null`, and `not null` is still null
@@ -1059,9 +1059,9 @@ name = "multipleConditions2"
query = '''
process where opcode == 1
and process_name in ("net.exe", "net1.exe")
- and not (parent_process_name == "net.exe"
- and process_name == "net1.exe")
- and command_line == "*group *admin*" and command_line != "* /add*"
+ and not (parent_process_name : "net.exe"
+ and process_name : "net1.exe")
+ and command_line : "*group *admin*" and command_line != "* /add*"
'''
expected_event_ids = [97]
@@ -1077,7 +1077,7 @@ any where true
name = "multipleConditionsWithDescendant1"
query = '''
process where opcode==1 and process_name in ("services.exe", "smss.exe", "lsass.exe")
- and descendant of [process where process_name == "cmd.exe" ]
+ and descendant of [process where process_name : "cmd.exe" ]
'''
expected_event_ids = [62, 68, 78]
@@ -1085,7 +1085,7 @@ expected_event_ids = [62, 68, 78]
name = "INWithDescendant"
query = '''
process where process_name in ("services.exe", "smss.exe", "lsass.exe")
- and descendant of [process where process_name == "cmd.exe" ]
+ and descendant of [process where process_name : "cmd.exe" ]
'''
expected_event_ids = [62, 64, 68, 69, 78, 80]
@@ -1093,23 +1093,23 @@ expected_event_ids = [62, 64, 68, 69, 78, 80]
name = "multipleConditionsWithDescendant2"
query = '''
process where opcode==2 and process_name in ("services.exe", "smss.exe", "lsass.exe")
- and descendant of [process where process_name == "cmd.exe" ]
+ and descendant of [process where process_name : "cmd.exe" ]
'''
expected_event_ids = [64, 69, 80]
[[queries]]
name = "childOf1"
query = '''
-process where process_name=="svchost.exe"
- and child of [file where file_name=="svchost.exe" and opcode==0]
+process where process_name:"svchost.exe"
+ and child of [file where file_name:"svchost.exe" and opcode==0]
'''
expected_event_ids = [56, 58]
[[queries]]
name = "childOf2"
query = '''
-process where process_name=="svchost.exe"
- and not child of [file where file_name=="svchost.exe" and opcode==0]
+process where process_name:"svchost.exe"
+ and not child of [file where file_name:"svchost.exe" and opcode==0]
| head 3
'''
expected_event_ids = [11, 13, 15]
@@ -1117,10 +1117,10 @@ expected_event_ids = [11, 13, 15]
[[queries]]
name = "nestedChildOf1"
query = '''
-process where process_name=="lsass.exe"
+process where process_name:"lsass.exe"
and child of [
- process where process_name=="python.exe"
- and child of [process where process_name=="cmd.exe"]
+ process where process_name:"python.exe"
+ and child of [process where process_name:"cmd.exe"]
]
'''
expected_event_ids = [62, 64]
@@ -1130,7 +1130,7 @@ name = "nestedChildOf2"
query = '''
file where child of [
process where child of [
- process where child of [process where process_name=="*wsmprovhost.exe"]
+ process where child of [process where process_name:"*wsmprovhost.exe"]
]
]
| tail 1
@@ -1140,7 +1140,7 @@ expected_event_ids = [91]
[[queries]]
name = "fileByUniquePid1"
query = '''
-file where process_name == "python.exe"
+file where process_name : "python.exe"
| unique unique_pid
'''
expected_event_ids = [55, 95]
@@ -1148,7 +1148,7 @@ expected_event_ids = [55, 95]
[[queries]]
name = "fileByUniquePid2"
query = '''
-file where event of [process where process_name == "python.exe" ]
+file where event of [process where process_name : "python.exe" ]
| unique unique_pid
'''
expected_event_ids = [55, 95]
@@ -1156,20 +1156,20 @@ expected_event_ids = [55, 95]
[[queries]]
name = "simpleStringEquality"
query = '''
-process where process_name == "python.exe"
+process where process_name : "python.exe"
'''
expected_event_ids = [48, 50, 51, 54, 93]
[[queries]]
name = "eventOfProcess"
-query = 'process where event of [process where process_name == "python.exe" ]'
+query = 'process where event of [process where process_name : "python.exe" ]'
expected_event_ids = [48, 50, 51, 54, 93]
[[queries]]
name = "twoSequencesWithKeys2"
query = '''
sequence
- [file where file_name=="lsass.exe"] by file_path,process_path
+ [file where file_name:"lsass.exe"] by file_path,process_path
[process where true] by process_path,parent_process_path
'''
expected_event_ids = [61, 62]
@@ -1178,7 +1178,7 @@ expected_event_ids = [61, 62]
name = "twoSequencesWithKeys3"
query = '''
sequence by user_name
- [file where file_name=="lsass.exe"] by file_path, process_path
+ [file where file_name:"lsass.exe"] by file_path, process_path
[process where true] by process_path, parent_process_path
'''
expected_event_ids = [61, 62]
@@ -1187,7 +1187,7 @@ expected_event_ids = [61, 62]
name = "twoSequencesWithKeys4"
query = '''
sequence by pid
- [file where file_name=="lsass.exe"] by file_path,process_path
+ [file where file_name:"lsass.exe"] by file_path,process_path
[process where true] by process_path,parent_process_path
'''
expected_event_ids = []
@@ -1263,21 +1263,21 @@ expected_event_ids = [54, 55, 56, 54, 61, 62, 54, 67, 68, 54, 72, 73]
[[queries]]
name = "wildcard1"
query = '''
-process where command_line == "*%*"
+process where command_line : "*%*"
'''
expected_event_ids = [4, 6, 28]
[[queries]]
name = "wildcard2"
query = '''
-process where command_line == "*%*%*"
+process where command_line : "*%*%*"
'''
expected_event_ids = [4, 6, 28]
[[queries]]
name = "wildcard3"
query = '''
-process where command_line == "%*%*"
+process where command_line : "%*%*"
'''
expected_event_ids = [4, 6, 28]
@@ -1285,7 +1285,7 @@ expected_event_ids = [4, 6, 28]
name = "uniqueCount1"
expected_event_ids = [11, 60, 63]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| unique_count event_type_full process_name
'''
@@ -1293,7 +1293,7 @@ any where process_name == "svchost.exe"
name = "uniqueCount2"
expected_event_ids = [63, 60, 11]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| sort event_type_full serial_event_id
| unique_count event_type_full process_name
'''
@@ -1302,7 +1302,7 @@ any where process_name == "svchost.exe"
name = "uniqueCount3"
expected_event_ids = [60]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| unique_count event_type_full opcode
| filter count == 7
'''
@@ -1311,7 +1311,7 @@ any where process_name == "svchost.exe"
name = "uniqueCountAndFilter"
expected_event_ids = [11]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| unique_count event_type_full opcode
| filter percent >= .5
'''
@@ -1338,7 +1338,7 @@ name = "lengthCaseInsensitive2"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] == "EN-us"
+registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] : "EN-us"
'''
[[queries]]
@@ -1346,7 +1346,7 @@ name = "arrayCaseInsensitive1"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[0] == "EN-us"
+registry where bytes_written_string_list[0] : "EN-us"
'''
[[queries]]
@@ -1354,7 +1354,7 @@ name = "arrayCaseInsensitive2"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[1] == "EN"
+registry where bytes_written_string_list[1] : "EN"
'''
@@ -1379,21 +1379,21 @@ name = "arrayCaseInsensitive3"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] == "en-US"
+registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] : "en-US"
'''
[[queries]]
name = "arrayEquality1"
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[0] == "en-US"
+registry where bytes_written_string_list[0] : "en-US"
'''
[[queries]]
name = "arrayEquality2"
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[1] == "en"
+registry where bytes_written_string_list[1] : "en"
'''
[[queries]]
@@ -1436,7 +1436,7 @@ name = "stringEqualsCaseInsensitive1"
case_insensitive = true
query = '''
process where "net.EXE" == original_file_name
-| filter process_name=="net*.exe"
+| filter process_name:"net*.exe"
'''
expected_event_ids = [97]
note = "check that case insensitive comparisons are performed even for lhs strings."
@@ -1445,7 +1445,7 @@ note = "check that case insensitive comparisons are performed even for lhs strin
name = "stringEqualsCaseInsensitive2"
case_insensitive = true
query = '''
-process where process_name == original_file_name and process_name=="net*.exe"
+process where process_name == original_file_name and process_name:"net*.exe"
'''
expected_event_ids = [97, 98]
note = "check that case insensitive comparisons are performed for fields."
@@ -1649,7 +1649,7 @@ description = "check substring ranges"
name = "substring1"
case_insensitive = true
query = '''
-file where serial_event_id==88 and substring(file_name, 0, 4) == "expl"
+file where serial_event_id==88 and substring(file_name, 0, 4) : "expl"
'''
expected_event_ids = [88]
description = "check substring ranges"
@@ -1667,7 +1667,7 @@ description = "check substring ranges"
name = "substring3"
case_insensitive = true
query = '''
-file where substring(file_name, 1, 3) == "xp"
+file where substring(file_name, 1, 3) : "xp"
'''
expected_event_ids = [88, 91, 92]
description = "check substring ranges"
@@ -1675,7 +1675,7 @@ description = "check substring ranges"
[[queries]]
name = "substring4"
query = '''
-file where substring(file_name, -4) == ".exe"
+file where substring(file_name, -4) : ".exe"
'''
expected_event_ids = [55, 59, 61, 65, 67, 70, 72, 75, 76, 81, 83, 86, 88, 91]
description = "check substring ranges"
@@ -1683,7 +1683,7 @@ description = "check substring ranges"
[[queries]]
name = "substring5"
query = '''
-file where substring(file_name, -4, -1) == ".ex"
+file where substring(file_name, -4, -1) : ".ex"
'''
expected_event_ids = [55, 59, 61, 65, 67, 70, 72, 75, 76, 81, 83, 86, 88, 91]
description = "check substring ranges"
@@ -1747,7 +1747,7 @@ process where serial_event_id == number("32", 16)
[[queries]]
name = "concat1"
query = '''
-process where concat(serial_event_id, ":", process_name, opcode) == "5:wininit.exe3"
+process where concat(serial_event_id, ":", process_name, opcode) : "5:wininit.exe3"
'''
expected_event_ids = [5]
description = "test string concatenation"
@@ -1756,7 +1756,7 @@ description = "test string concatenation"
name = "concatCaseInsensitive"
case_insensitive = true
query = '''
-process where concat(serial_event_id, ":", process_name, opcode) == "5:winINIT.exe3"
+process where concat(serial_event_id, ":", process_name, opcode) : "5:winINIT.exe3"
'''
expected_event_ids = [5]
description = "test string concatenation"
@@ -1776,7 +1776,7 @@ name = "arraySearch1"
expected_event_ids = [57]
description = "test arraySearch functionality for lists of strings, and lists of objects"
query = '''
-registry where arraySearch(bytes_written_string_list, a, a == "en-US")
+registry where arraySearch(bytes_written_string_list, a, a : "en-US")
'''
[[queries]]
@@ -1785,7 +1785,7 @@ case_sensitive = true
expected_event_ids = []
description = "test arraySearch functionality for lists of strings, and lists of objects"
query = '''
-registry where arraySearch(bytes_written_string_list, a, a == "EN-US")
+registry where arraySearch(bytes_written_string_list, a, a : "EN-US")
'''
[[queries]]
@@ -1794,7 +1794,7 @@ case_insensitive = true
expected_event_ids = [57]
description = "test arraySearch functionality for lists of strings, and lists of objects"
query = '''
-registry where arraySearch(bytes_written_string_list, a, a == "en-us")
+registry where arraySearch(bytes_written_string_list, a, a : "en-us")
'''
[[queries]]
@@ -1828,7 +1828,7 @@ name = "arraySearchWithMysteriousField3"
expected_event_ids = [75305]
description = "test arraySearch - conditional"
query = '''
-network where mysterious_field and arraySearch(mysterious_field.subarray, s, s.a == "s0-*")
+network where mysterious_field and arraySearch(mysterious_field.subarray, s, s.a : "s0-*")
'''
[[queries]]
@@ -1846,7 +1846,7 @@ description = "test arraySearch - nested"
query = '''
network where mysterious_field
and arraySearch(mysterious_field.subarray, sub1,
- arraySearch(sub1.c, nested, nested.x.y == "*"))
+ arraySearch(sub1.c, nested, nested.x.y : "*"))
'''
[[queries]]
@@ -1856,7 +1856,7 @@ description = "test arraySearch - nested with cross-check pass"
query = '''
network where mysterious_field
and arraySearch(mysterious_field.subarray, sub1,
- sub1.a == "s0-a" and arraySearch(sub1.c, nested, nested.z == "s0-c1-x-z"))
+ sub1.a : "s0-a" and arraySearch(sub1.c, nested, nested.z : "s0-c1-x-z"))
'''
[[queries]]
@@ -1866,7 +1866,7 @@ description = "test arraySearch - nested with cross-check pass"
query = '''
network where mysterious_field
and arraySearch(mysterious_field.subarray, sub1,
- sub1.a == "s0-a" and arraySearch(sub1.c, nested, nested.z == sub1.cross_match))
+ sub1.a : "s0-a" and arraySearch(sub1.c, nested, nested.z == sub1.cross_match))
'''
[[queries]]
@@ -1901,7 +1901,7 @@ name = "arrayCount1"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where arrayCount(bytes_written_string_list, s, s == "*-us") == 1
+registry where arrayCount(bytes_written_string_list, s, s : "*-us") == 1
'''
[[queries]]
@@ -1909,7 +1909,7 @@ name = "arrayCount2"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where arrayCount(bytes_written_string_list, s, s == "*en*") == 2
+registry where arrayCount(bytes_written_string_list, s, s : "*en*") == 2
'''
[[queries]]
@@ -1955,7 +1955,7 @@ name = "betweenCaseInsensitive1"
case_insensitive = true
expected_event_ids = [1, 2]
query = '''
-process where between(process_name, "s", "e") == "yst"
+process where between(process_name, "s", "e") : "yst"
'''
[[queries]]
@@ -1963,7 +1963,7 @@ name = "betweenCaseInsensitive2"
case_insensitive = true
expected_event_ids = [1, 2]
query = '''
-process where between(process_name, "s", "e", false) == "yst"
+process where between(process_name, "s", "e", false) : "yst"
'''
[[queries]]
@@ -1971,14 +1971,14 @@ name = "betweenCaseSensitive"
case_sensitive = true
expected_event_ids = [1, 2, 42]
query = '''
-process where between(process_name, "s", "e", false) == "t"
+process where between(process_name, "s", "e", false) : "t"
'''
[[queries]]
name = "between1"
expected_event_ids = [1]
query = '''
-process where between(process_name, "S", "e", true) == "ystem Idle Proc"
+process where between(process_name, "S", "e", true) : "ystem Idle Proc"
'''
[[queries]]
@@ -1986,21 +1986,21 @@ name = "betweenCaseInsensitive3"
case_insensitive = true
expected_event_ids = [1]
query = '''
-process where between(process_name, "s", "e", true) == "ystem Idle Proc"
+process where between(process_name, "s", "e", true) : "ystem Idle Proc"
'''
[[queries]]
name = "between2"
expected_event_ids = [95]
query = '''
-file where between(file_path, "dev", ".json", false) == "\\TestLogs\\something"
+file where between(file_path, "dev", ".json", false) : "\\TestLogs\\something"
'''
[[queries]]
name = "between3"
expected_event_ids = [95]
query = '''
-file where between(file_path, "dev", ".json", true) == "\\TestLogs\\something"
+file where between(file_path, "dev", ".json", true) : "\\TestLogs\\something"
'''
diff --git a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries_unsupported.toml b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries_unsupported.toml
index e9fef03a995..012d424a140 100644
--- a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries_unsupported.toml
+++ b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries_unsupported.toml
@@ -134,7 +134,7 @@ expected_event_ids = [1, 2]
name = "processWithStringEqualityCaseInsensitive1"
case_insensitive = true
query = '''
-process where process_name == "VMACTHLP.exe" and unique_pid == 12
+process where process_name : "VMACTHLP.exe" and unique_pid == 12
| filter true
'''
expected_event_ids = [12]
@@ -232,33 +232,33 @@ name = "lengthCaseInsensitive"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where length(bytes_written_string_list) == 2 and bytes_written_string_list[1] == "EN"
+registry where length(bytes_written_string_list) == 2 and bytes_written_string_list[1] : "EN"
'''
[[queries]]
name = "descendant1"
query = '''
-file where file_name == "csrss.exe" and opcode==0
- and descendant of [process where opcode in (1,3) and process_name=="cmd.exe"]
+file where file_name : "csrss.exe" and opcode==0
+ and descendant of [process where opcode in (1,3) and process_name:"cmd.exe"]
'''
expected_event_ids = [72]
[[queries]]
name = "descendant2"
query = '''
-process where opcode==1 and process_name == "csrss.exe"
- and descendant of [file where file_name == "csrss.exe" and opcode==0]
+process where opcode==1 and process_name : "csrss.exe"
+ and descendant of [file where file_name : "csrss.exe" and opcode==0]
'''
expected_event_ids = [73]
[[queries]]
name = "descendant3"
query = '''
-process where opcode==1 and process_name == "smss.exe"
+process where opcode==1 and process_name : "smss.exe"
and descendant of [
- file where file_name == "csrss.exe" and opcode==0
+ file where file_name : "csrss.exe" and opcode==0
and descendant of [
- process where opcode in(1,3) and process_name=="cmd.exe"
+ process where opcode in(1,3) and process_name:"cmd.exe"
]
]
'''
@@ -359,8 +359,8 @@ expected_event_ids = [87, 92]
name = "doubleSameSequenceWithByUntilAndHead2"
query = '''
join
- [file where opcode==0 and file_name=="*.exe"] by unique_pid
- [file where opcode==2 and file_name=="*.exe"] by unique_pid
+ [file where opcode==0 and file_name:"*.exe"] by unique_pid
+ [file where opcode==2 and file_name:"*.exe"] by unique_pid
until [process where opcode==1] by unique_ppid
| head 1
'''
@@ -370,8 +370,8 @@ expected_event_ids = [61, 59]
name = "twoJoins1"
query = '''
join by user_name
- [process where opcode in (1,3) and process_name=="smss.exe"]
- [process where opcode in (1,3) and process_name == "python.exe"]
+ [process where opcode in (1,3) and process_name:"smss.exe"]
+ [process where opcode in (1,3) and process_name : "python.exe"]
'''
expected_event_ids = [78, 48]
@@ -380,8 +380,8 @@ name = "threeJoins1"
query = '''
join by unique_pid
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
'''
expected_event_ids = [54, 55, 61]
@@ -390,8 +390,8 @@ name = "threeJoins2"
query = '''
join by string(unique_pid)
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
'''
expected_event_ids = [54, 55, 61]
@@ -400,8 +400,8 @@ name = "threeJoinsWithUntil1"
query = '''
join by unique_pid
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
until [file where opcode == 2]
'''
expected_event_ids = []
@@ -411,8 +411,8 @@ name = "threeJoinsWithUntil1"
query = '''
join by string(unique_pid), unique_pid, unique_pid * 2
[process where opcode==1]
- [file where opcode==0 and file_name=="svchost.exe"]
- [file where opcode == 0 and file_name == "lsass.exe"]
+ [file where opcode==0 and file_name:"svchost.exe"]
+ [file where opcode == 0 and file_name : "lsass.exe"]
until [file where opcode == 2]
'''
expected_event_ids = []
@@ -421,7 +421,7 @@ expected_event_ids = []
name = "twoJoins2"
query = '''
join
- [file where opcode==0 and file_name=="svchost.exe"] by unique_pid
+ [file where opcode==0 and file_name:"svchost.exe"] by unique_pid
[process where opcode == 1] by unique_ppid
'''
expected_event_ids = [55, 56]
@@ -430,8 +430,8 @@ expected_event_ids = [55, 56]
name = "twoJoins3"
query = '''
join by unique_pid
- [process where opcode in (1,3) and process_name=="python.exe"]
- [file where file_name == "*.exe"]
+ [process where opcode in (1,3) and process_name:"python.exe"]
+ [file where file_name : "*.exe"]
'''
expected_event_ids = [54, 55]
@@ -439,8 +439,8 @@ expected_event_ids = [54, 55]
name = "twoJoins4"
query = '''
join by user_name
- [process where opcode in (1,3) and process_name=="python.exe"]
- [process where opcode in (1,3) and process_name == "smss.exe"]
+ [process where opcode in (1,3) and process_name:"python.exe"]
+ [process where opcode in (1,3) and process_name : "smss.exe"]
'''
expected_event_ids = [48, 78]
@@ -448,8 +448,8 @@ expected_event_ids = [48, 78]
name = "twoJoins5"
query = '''
join
- [process where opcode in (1,3) and process_name=="python.exe"]
- [process where opcode in (1,3) and process_name == "smss.exe"]
+ [process where opcode in (1,3) and process_name:"python.exe"]
+ [process where opcode in (1,3) and process_name : "smss.exe"]
'''
expected_event_ids = [48, 3, 50, 78]
@@ -457,7 +457,7 @@ expected_event_ids = [48, 3, 50, 78]
name = "fakeField"
expected_event_ids = []
query = '''
-process where fake_field == "*"
+process where fake_field : "*"
'''
[[queries]]
@@ -476,7 +476,7 @@ name = "fakeFieldWithHead2"
# expected_event_ids = [1, 2, 3, 4]
expected_event_ids = []
query = '''
-process where not (fake_field == "*")
+process where not (fake_field : "*")
| head 4
'''
@@ -569,7 +569,7 @@ any where true
name = "multipleConditionsWithDescendant1"
query = '''
process where opcode==1 and process_name in ("services.exe", "smss.exe", "lsass.exe")
- and descendant of [process where process_name == "cmd.exe" ]
+ and descendant of [process where process_name : "cmd.exe" ]
'''
expected_event_ids = [62, 68, 78]
@@ -577,7 +577,7 @@ expected_event_ids = [62, 68, 78]
name = "INWithDescendant"
query = '''
process where process_name in ("services.exe", "smss.exe", "lsass.exe")
- and descendant of [process where process_name == "cmd.exe" ]
+ and descendant of [process where process_name : "cmd.exe" ]
'''
expected_event_ids = [62, 64, 68, 69, 78, 80]
@@ -585,23 +585,23 @@ expected_event_ids = [62, 64, 68, 69, 78, 80]
name = "multipleConditionsWithDescendant2"
query = '''
process where opcode==2 and process_name in ("services.exe", "smss.exe", "lsass.exe")
- and descendant of [process where process_name == "cmd.exe" ]
+ and descendant of [process where process_name : "cmd.exe" ]
'''
expected_event_ids = [64, 69, 80]
[[queries]]
name = "childOf1"
query = '''
-process where process_name=="svchost.exe"
- and child of [file where file_name=="svchost.exe" and opcode==0]
+process where process_name:"svchost.exe"
+ and child of [file where file_name:"svchost.exe" and opcode==0]
'''
expected_event_ids = [56, 58]
[[queries]]
name = "childOf2"
query = '''
-process where process_name=="svchost.exe"
- and not child of [file where file_name=="svchost.exe" and opcode==0]
+process where process_name:"svchost.exe"
+ and not child of [file where file_name:"svchost.exe" and opcode==0]
| head 3
'''
expected_event_ids = [11, 13, 15]
@@ -609,10 +609,10 @@ expected_event_ids = [11, 13, 15]
[[queries]]
name = "nestedChildOf1"
query = '''
-process where process_name=="lsass.exe"
+process where process_name:"lsass.exe"
and child of [
- process where process_name=="python.exe"
- and child of [process where process_name=="cmd.exe"]
+ process where process_name:"python.exe"
+ and child of [process where process_name:"cmd.exe"]
]
'''
expected_event_ids = [62, 64]
@@ -622,7 +622,7 @@ name = "nestedChildOf2"
query = '''
file where child of [
process where child of [
- process where child of [process where process_name=="*wsmprovhost.exe"]
+ process where child of [process where process_name:"*wsmprovhost.exe"]
]
]
| tail 1
@@ -632,7 +632,7 @@ expected_event_ids = [91]
[[queries]]
name = "fileByUniquePid1"
query = '''
-file where process_name == "python.exe"
+file where process_name : "python.exe"
| unique unique_pid
'''
expected_event_ids = [55, 95]
@@ -640,7 +640,7 @@ expected_event_ids = [55, 95]
[[queries]]
name = "fileByUniquePid2"
query = '''
-file where event of [process where process_name == "python.exe" ]
+file where event of [process where process_name : "python.exe" ]
| unique unique_pid
'''
expected_event_ids = [55, 95]
@@ -648,13 +648,13 @@ expected_event_ids = [55, 95]
[[queries]]
name = "simpleStringEquality"
query = '''
-process where process_name == "python.exe"
+process where process_name : "python.exe"
'''
expected_event_ids = [48, 50, 51, 54, 93]
[[queries]]
name = "eventOfProcess"
-query = 'process where event of [process where process_name == "python.exe" ]'
+query = 'process where event of [process where process_name : "python.exe" ]'
expected_event_ids = [48, 50, 51, 54, 93]
[[queries]]
@@ -682,7 +682,7 @@ expected_event_ids = [54, 55, 56, 54, 61, 62, 54, 67, 68, 54, 72, 73]
name = "uniqueCount1"
expected_event_ids = [11, 60, 63]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| unique_count event_type_full process_name
'''
@@ -690,7 +690,7 @@ any where process_name == "svchost.exe"
name = "uniqueCount2"
expected_event_ids = [63, 60, 11]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| sort event_type_full serial_event_id
| unique_count event_type_full process_name
'''
@@ -699,7 +699,7 @@ any where process_name == "svchost.exe"
name = "uniqueCount3"
expected_event_ids = [60]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| unique_count event_type_full opcode
| filter count == 7
'''
@@ -708,7 +708,7 @@ any where process_name == "svchost.exe"
name = "uniqueCountAndFilter"
expected_event_ids = [11]
query = '''
-any where process_name == "svchost.exe"
+any where process_name : "svchost.exe"
| unique_count event_type_full opcode
| filter percent >= .5
'''
@@ -735,7 +735,7 @@ name = "lengthCaseInsensitive"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] == "EN-us"
+registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] : "EN-us"
'''
[[queries]]
@@ -743,7 +743,7 @@ name = "arrayCaseInsensitive1"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[0] == "EN-us"
+registry where bytes_written_string_list[0] : "EN-us"
'''
[[queries]]
@@ -751,7 +751,7 @@ name = "arrayCaseInsensitive2"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[1] == "EN"
+registry where bytes_written_string_list[1] : "EN"
'''
@@ -776,21 +776,21 @@ name = "arrayCaseInsensitive3"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] == "en-US"
+registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] : "en-US"
'''
[[queries]]
name = "arrayEquality1"
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[0] == "en-US"
+registry where bytes_written_string_list[0] : "en-US"
'''
[[queries]]
name = "arrayEquality2"
expected_event_ids = [57]
query = '''
-registry where bytes_written_string_list[1] == "en"
+registry where bytes_written_string_list[1] : "en"
'''
# character classes aren't supported. custom tests made in test_queries_supported.toml
@@ -834,7 +834,7 @@ name = "stringEqualsCaseInsensitive1"
case_insensitive = true
query = '''
process where "net.EXE" == original_file_name
-| filter process_name=="net*.exe"
+| filter process_name:"net*.exe"
'''
expected_event_ids = [97]
note = "check that case insensitive comparisons are performed even for lhs strings."
@@ -843,7 +843,7 @@ note = "check that case insensitive comparisons are performed even for lhs strin
name = "stringEqualsCaseInsensitive2"
case_insensitive = true
query = '''
-process where process_name == original_file_name and process_name=="net*.exe"
+process where process_name == original_file_name and process_name:"net*.exe"
'''
expected_event_ids = [97, 98]
note = "check that case insensitive comparisons are performed for fields."
@@ -861,7 +861,7 @@ description = "check that case insensitive comparisons are performed for fields.
name = "substring3"
case_insensitive = true
query = '''
-file where substring(file_name, 1, 3) == "xp"
+file where substring(file_name, 1, 3) : "xp"
'''
expected_event_ids = [88, 91, 92]
description = "check substring ranges"
@@ -878,7 +878,7 @@ description = "test built-in math functions"
name = "concatCaseInsensitive"
case_insensitive = true
query = '''
-process where concat(serial_event_id, ":", process_name, opcode) == "5:winINIT.exe3"
+process where concat(serial_event_id, ":", process_name, opcode) : "5:winINIT.exe3"
'''
expected_event_ids = [5]
description = "test string concatenation"
@@ -898,7 +898,7 @@ name = "arraySearch1"
expected_event_ids = [57]
description = "test arraySearch functionality for lists of strings, and lists of objects"
query = '''
-registry where arraySearch(bytes_written_string_list, a, a == "en-US")
+registry where arraySearch(bytes_written_string_list, a, a : "en-US")
'''
[[queries]]
@@ -907,7 +907,7 @@ case_sensitive = true
expected_event_ids = []
description = "test arraySearch functionality for lists of strings, and lists of objects"
query = '''
-registry where arraySearch(bytes_written_string_list, a, a == "EN-US")
+registry where arraySearch(bytes_written_string_list, a, a : "EN-US")
'''
[[queries]]
@@ -916,7 +916,7 @@ case_insensitive = true
expected_event_ids = [57]
description = "test arraySearch functionality for lists of strings, and lists of objects"
query = '''
-registry where arraySearch(bytes_written_string_list, a, a == "en-us")
+registry where arraySearch(bytes_written_string_list, a, a : "en-us")
'''
[[queries]]
@@ -950,7 +950,7 @@ name = "arraySearchWithMysteriousField3"
expected_event_ids = [75305]
description = "test arraySearch - conditional"
query = '''
-network where mysterious_field and arraySearch(mysterious_field.subarray, s, s.a == "s0-*")
+network where mysterious_field and arraySearch(mysterious_field.subarray, s, s.a : "s0-*")
'''
[[queries]]
@@ -968,7 +968,7 @@ description = "test arraySearch - nested"
query = '''
network where mysterious_field
and arraySearch(mysterious_field.subarray, sub1,
- arraySearch(sub1.c, nested, nested.x.y == "*"))
+ arraySearch(sub1.c, nested, nested.x.y : "*"))
'''
[[queries]]
@@ -978,7 +978,7 @@ description = "test arraySearch - nested with cross-check pass"
query = '''
network where mysterious_field
and arraySearch(mysterious_field.subarray, sub1,
- sub1.a == "s0-a" and arraySearch(sub1.c, nested, nested.z == "s0-c1-x-z"))
+ sub1.a : "s0-a" and arraySearch(sub1.c, nested, nested.z : "s0-c1-x-z"))
'''
[[queries]]
@@ -988,7 +988,7 @@ description = "test arraySearch - nested with cross-check pass"
query = '''
network where mysterious_field
and arraySearch(mysterious_field.subarray, sub1,
- sub1.a == "s0-a" and arraySearch(sub1.c, nested, nested.z == sub1.cross_match))
+ sub1.a : "s0-a" and arraySearch(sub1.c, nested, nested.z == sub1.cross_match))
'''
[[queries]]
@@ -1023,7 +1023,7 @@ name = "arrayCount1"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where arrayCount(bytes_written_string_list, s, s == "*-us") == 1
+registry where arrayCount(bytes_written_string_list, s, s : "*-us") == 1
'''
[[queries]]
@@ -1031,7 +1031,7 @@ name = "arrayCount2"
case_insensitive = true
expected_event_ids = [57]
query = '''
-registry where arrayCount(bytes_written_string_list, s, s == "*en*") == 2
+registry where arrayCount(bytes_written_string_list, s, s : "*en*") == 2
'''
[[queries]]
@@ -1072,7 +1072,7 @@ name = "betweenCaseSensitive"
case_sensitive = true
expected_event_ids = [1, 2, 42]
query = '''
-process where between(process_name, "s", "e", false) == "t"
+process where between(process_name, "s", "e", false) : "t"
'''
# TODO: add toggles to this function so it's not always insensitive
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
index c24e748c032..5c6d59cbb1f 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
@@ -65,7 +65,7 @@ subquery
eventQuery
: eventFilter
;
-
+
eventFilter
: (ANY | event=identifier) WHERE expression
;
@@ -121,7 +121,7 @@ constant
;
comparisonOperator
- : EQ | NEQ | LT | LTE | GT | GTE
+ : SEQ | EQ | NEQ | LT | LTE | GT | GTE
;
booleanValue
@@ -168,6 +168,9 @@ WHERE: 'where';
WITH: 'with';
// Operators
+// dedicated string equality - case-insensitive and supporting * operator
+SEQ : ':';
+// regular operators
ASGN : '=';
EQ : '==';
NEQ : '!=';
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.tokens b/x-pack/plugin/eql/src/main/antlr/EqlBase.tokens
index a1bde64e87e..fcbe45b3615 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.tokens
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.tokens
@@ -14,33 +14,34 @@ TRUE=13
UNTIL=14
WHERE=15
WITH=16
-ASGN=17
-EQ=18
-NEQ=19
-LT=20
-LTE=21
-GT=22
-GTE=23
-PLUS=24
-MINUS=25
-ASTERISK=26
-SLASH=27
-PERCENT=28
-DOT=29
-COMMA=30
-LB=31
-RB=32
-LP=33
-RP=34
-PIPE=35
-ESCAPED_IDENTIFIER=36
-STRING=37
-INTEGER_VALUE=38
-DECIMAL_VALUE=39
-IDENTIFIER=40
-LINE_COMMENT=41
-BRACKETED_COMMENT=42
-WS=43
+SEQ=17
+ASGN=18
+EQ=19
+NEQ=20
+LT=21
+LTE=22
+GT=23
+GTE=24
+PLUS=25
+MINUS=26
+ASTERISK=27
+SLASH=28
+PERCENT=29
+DOT=30
+COMMA=31
+LB=32
+RB=33
+LP=34
+RP=35
+PIPE=36
+ESCAPED_IDENTIFIER=37
+STRING=38
+INTEGER_VALUE=39
+DECIMAL_VALUE=40
+IDENTIFIER=41
+LINE_COMMENT=42
+BRACKETED_COMMENT=43
+WS=44
'and'=1
'any'=2
'by'=3
@@ -57,22 +58,23 @@ WS=43
'until'=14
'where'=15
'with'=16
-'='=17
-'=='=18
-'!='=19
-'<'=20
-'<='=21
-'>'=22
-'>='=23
-'+'=24
-'-'=25
-'*'=26
-'/'=27
-'%'=28
-'.'=29
-','=30
-'['=31
-']'=32
-'('=33
-')'=34
-'|'=35
+':'=17
+'='=18
+'=='=19
+'!='=20
+'<'=21
+'<='=22
+'>'=23
+'>='=24
+'+'=25
+'-'=26
+'*'=27
+'/'=28
+'%'=29
+'.'=30
+','=31
+'['=32
+']'=33
+'('=34
+')'=35
+'|'=36
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens b/x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens
index a1bde64e87e..fcbe45b3615 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens
@@ -14,33 +14,34 @@ TRUE=13
UNTIL=14
WHERE=15
WITH=16
-ASGN=17
-EQ=18
-NEQ=19
-LT=20
-LTE=21
-GT=22
-GTE=23
-PLUS=24
-MINUS=25
-ASTERISK=26
-SLASH=27
-PERCENT=28
-DOT=29
-COMMA=30
-LB=31
-RB=32
-LP=33
-RP=34
-PIPE=35
-ESCAPED_IDENTIFIER=36
-STRING=37
-INTEGER_VALUE=38
-DECIMAL_VALUE=39
-IDENTIFIER=40
-LINE_COMMENT=41
-BRACKETED_COMMENT=42
-WS=43
+SEQ=17
+ASGN=18
+EQ=19
+NEQ=20
+LT=21
+LTE=22
+GT=23
+GTE=24
+PLUS=25
+MINUS=26
+ASTERISK=27
+SLASH=28
+PERCENT=29
+DOT=30
+COMMA=31
+LB=32
+RB=33
+LP=34
+RP=35
+PIPE=36
+ESCAPED_IDENTIFIER=37
+STRING=38
+INTEGER_VALUE=39
+DECIMAL_VALUE=40
+IDENTIFIER=41
+LINE_COMMENT=42
+BRACKETED_COMMENT=43
+WS=44
'and'=1
'any'=2
'by'=3
@@ -57,22 +58,23 @@ WS=43
'until'=14
'where'=15
'with'=16
-'='=17
-'=='=18
-'!='=19
-'<'=20
-'<='=21
-'>'=22
-'>='=23
-'+'=24
-'-'=25
-'*'=26
-'/'=27
-'%'=28
-'.'=29
-','=30
-'['=31
-']'=32
-'('=33
-')'=34
-'|'=35
+':'=17
+'='=18
+'=='=19
+'!='=20
+'<'=21
+'<='=22
+'>'=23
+'>='=24
+'+'=25
+'-'=26
+'*'=27
+'/'=28
+'%'=29
+'.'=30
+','=31
+'['=32
+']'=33
+'('=34
+')'=35
+'|'=36
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/expression/function/scalar/whitelist/InternalEqlScriptUtils.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/expression/function/scalar/whitelist/InternalEqlScriptUtils.java
index 9443fde3784..c0cf355ab52 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/expression/function/scalar/whitelist/InternalEqlScriptUtils.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/expression/function/scalar/whitelist/InternalEqlScriptUtils.java
@@ -6,6 +6,7 @@
package org.elasticsearch.xpack.eql.expression.function.scalar.whitelist;
+import org.elasticsearch.xpack.eql.expression.function.scalar.math.ToNumberFunctionProcessor;
import org.elasticsearch.xpack.eql.expression.function.scalar.string.BetweenFunctionProcessor;
import org.elasticsearch.xpack.eql.expression.function.scalar.string.CIDRMatchFunctionProcessor;
import org.elasticsearch.xpack.eql.expression.function.scalar.string.ConcatFunctionProcessor;
@@ -14,12 +15,13 @@ import org.elasticsearch.xpack.eql.expression.function.scalar.string.IndexOfFunc
import org.elasticsearch.xpack.eql.expression.function.scalar.string.LengthFunctionProcessor;
import org.elasticsearch.xpack.eql.expression.function.scalar.string.StringContainsFunctionProcessor;
import org.elasticsearch.xpack.eql.expression.function.scalar.string.SubstringFunctionProcessor;
-import org.elasticsearch.xpack.eql.expression.function.scalar.math.ToNumberFunctionProcessor;
import org.elasticsearch.xpack.eql.expression.function.scalar.string.ToStringFunctionProcessor;
import org.elasticsearch.xpack.ql.expression.function.scalar.whitelist.InternalQlScriptUtils;
import java.util.List;
+import static org.elasticsearch.xpack.eql.expression.predicate.operator.comparison.InsensitiveBinaryComparisonProcessor.InsensitiveBinaryComparisonOperation;
+
/*
* Whitelisted class for EQL scripts.
* Acts as a registry of the various static methods used internally by the scalar functions
@@ -29,6 +31,14 @@ public class InternalEqlScriptUtils extends InternalQlScriptUtils {
InternalEqlScriptUtils() {}
+ public static Boolean seq(Object left, Object right) {
+ return InsensitiveBinaryComparisonOperation.SEQ.apply(left, right);
+ }
+
+ public static Boolean sneq(Object left, Object right) {
+ return InsensitiveBinaryComparisonOperation.SNEQ.apply(left, right);
+ }
+
public static String between(String s, String left, String right, Boolean greedy, Boolean caseSensitive) {
return (String) BetweenFunctionProcessor.doProcess(s, left, right, greedy, caseSensitive);
}
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/expression/predicate/operator/comparison/InsensitiveBinaryComparison.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/expression/predicate/operator/comparison/InsensitiveBinaryComparison.java
new file mode 100644
index 00000000000..4de323d7294
--- /dev/null
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/expression/predicate/operator/comparison/InsensitiveBinaryComparison.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+package org.elasticsearch.xpack.eql.expression.predicate.operator.comparison;
+
+import org.elasticsearch.common.logging.LoggerMessageFormat;
+import org.elasticsearch.xpack.eql.expression.predicate.operator.comparison.InsensitiveBinaryComparisonProcessor.InsensitiveBinaryComparisonOperation;
+import org.elasticsearch.xpack.ql.expression.Expression;
+import org.elasticsearch.xpack.ql.expression.Expressions;
+import org.elasticsearch.xpack.ql.expression.Expressions.ParamOrdinal;
+import org.elasticsearch.xpack.ql.expression.TypeResolutions;
+import org.elasticsearch.xpack.ql.expression.gen.pipeline.Pipe;
+import org.elasticsearch.xpack.ql.expression.predicate.BinaryOperator;
+import org.elasticsearch.xpack.ql.tree.Source;
+import org.elasticsearch.xpack.ql.type.DataType;
+import org.elasticsearch.xpack.ql.type.DataTypes;
+
+import java.time.ZoneId;
+
+// marker class to indicate operations that rely on values
+public abstract class InsensitiveBinaryComparison extends BinaryOperator