Skip to content

EQL: ambiguous syntax for chained predicates #61654

Closed
@rw-access

Description

@rw-access

Existing implementations of EQL have peg-based grammars, and as part of the design can't support chaining predicates.

For example, 1 == 1 == 1 raises a syntax error. This seems like good behavior, forcing the user to do (1 == 1) == 1.

$ eql query 'any where 1 == 1 == 1'
Error at line:1,column:18
Invalid syntax
any where 1 == 1 == 1
                 ^

Then you get this

$ eql query 'any where (1 == 1) == 1'
Error at line:1,column:11
Invalid comparison of boolean to number
any where (1 == 1) == 1
          ^^^^^^^^^^^^^

However, for Elasticsearch, we accept this syntax. But it's not clear what it means.
(I think there's another issue here with data type validation isn't detecting a type mismatch with (bool) == long

GET logs-endpoint.alerts-default/_eql/search
{
  "query": """
    any where 1 == 1 == 1
  """
  ,
  "size": 1
}
GET logs-endpoint.alerts-default/_eql/search
{
  "query": """
    any where 1 < 2 < 3
  """
  ,
  "size": 1
}

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions