Skip to content

Commit ad5ae4d

Browse files
authored
EQL: Remove support for = for comparisons (#62756)
Since `=` is rarely used and is undocumented we its support for equality comparisons keeping `==` as the only option. `=` is now only used for assignments like in `maxspan=10m`. Closes: #62650
1 parent 39a6dec commit ad5ae4d

File tree

24 files changed

+599
-587
lines changed

24 files changed

+599
-587
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/EqlIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void testEqualsInFilterConditionSearch() throws Exception {
141141
EqlClient eql = highLevelClient().eql();
142142

143143
EqlSearchRequest request = new EqlSearchRequest("index",
144-
"process where event_type_full = \"process_event\" and serial_event_id in (1,3,5)");
144+
"process where event_type_full == \"process_event\" and serial_event_id in (1,3,5)");
145145

146146
EqlSearchResponse response = execute(request, eql::search, eql::searchAsync);
147147
assertResponse(response, 3);

docs/reference/eql/eql-search-api.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ event.
1919
GET /my-index-000001/_eql/search
2020
{
2121
"query": """
22-
process where process.name = "regsvr32.exe"
22+
process where process.name == "regsvr32.exe"
2323
"""
2424
}
2525
----

x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/stats/RestEqlUsageTestCase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void testEqlRestUsage() throws IOException {
146146
int randomSequenceExecutions = randomIntBetween(1, 15);
147147
allTotalQueries += randomSequenceExecutions;
148148
for (int i = 0; i < randomSequenceExecutions; i++) {
149-
runEql("sequence [process where serial_event_id = 1] [process where serial_event_id = 2]");
149+
runEql("sequence [process where serial_event_id == 1] [process where serial_event_id == 2]");
150150
}
151151
responseAsMap = getStats();
152152
metricsToCheck = Set.of("sequence", "sequence_queries_two", "pipe_head");
@@ -179,7 +179,7 @@ public void testEqlRestUsage() throws IOException {
179179
" [process where opcode == 1] by user" +
180180
" [process where opcode == 2] by user" +
181181
" [file where parent_process_name == \\\"file_delete_event\\\"] by exit_code" +
182-
" until [process where opcode=1] by ppid" +
182+
" until [process where opcode==1] by ppid" +
183183
" | head 4" +
184184
" | tail 2");
185185
}
@@ -271,8 +271,8 @@ public void testEqlRestUsage() throws IOException {
271271
runEql(
272272
randomFrom(
273273
"process where missing_field < 4 | tail 2",
274-
"sequence abc [process where serial_event_id = 1]",
275-
"sequence with maxspan=1x [process where serial_event_id = 1]",
274+
"sequence abc [process where serial_event_id == 1]",
275+
"sequence with maxspan=1x [process where serial_event_id == 1]",
276276
"sequence by exit_code, user [process where serial_event_id < 4] by ppid",
277277
"sequence by"
278278
)

x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ expected_event_ids = [5]
6969

7070
[[queries]]
7171
name = "concatEquals2"
72-
query = 'process where concat(serial_event_id) = "1"'
72+
query = 'process where concat(serial_event_id) == "1"'
7373
expected_event_ids = [1]
7474

7575
[[queries]]
@@ -98,7 +98,7 @@ expected_event_ids = [1, 2, 3, 4]
9898

9999
[[queries]]
100100
name = "numberStringConversion1"
101-
query = 'process where string(serial_event_id) = "1"'
101+
query = 'process where string(serial_event_id) == "1"'
102102
expected_event_ids = [1]
103103

104104

@@ -223,16 +223,16 @@ query = "process where serial_event_id + ((1 + 3) * 2 / (3 - 1)) * 2 == 54 or 70
223223
name = "twoSequencesAdditional1"
224224
query = '''
225225
sequence
226-
[process where serial_event_id = 1]
227-
[process where serial_event_id = 2]
226+
[process where serial_event_id == 1]
227+
[process where serial_event_id == 2]
228228
'''
229229
expected_event_ids = [1, 2]
230230

231231
[[queries]]
232232
name = "twoSequencesAdditional2"
233233
query = '''
234234
sequence
235-
[process where serial_event_id=1] by unique_pid
235+
[process where serial_event_id==1] by unique_pid
236236
[process where true] by unique_ppid'''
237237
expected_event_ids = [1, 2]
238238

0 commit comments

Comments
 (0)