Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] EQL: Add wildcard support to : operator #65237

Merged
merged 1 commit into from
Nov 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions docs/reference/eql/syntax.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ the value to the right. Otherwise returns `false`.

`==` (equal, case-sensitive)::
Returns `true` if the values to the left and right of the operator are equal.
Otherwise returns `false`. For strings, matching is case-sensitive.
Otherwise returns `false`. For strings, matching is case-sensitive. Wildcards
are not supported.

`:` (equal, case-insensitive)::
Returns `true` if strings to the left and right of the operator are equal.
Otherwise returns `false`. Matching is case-insensitive and can only be used to
compare strings.
compare strings. <<eql-syntax-wildcards,Wildcards>> are supported.

[IMPORTANT]
====
Expand All @@ -150,6 +151,7 @@ DSL filter>> that contains a <<query-dsl-match-query,`match`>> query.
`!=` (not equal, case-sensitive)::
Returns `true` if the values to the left and right of the operator are not
equal. Otherwise returns `false`. For strings, matching is case-sensitive.
Wildcards are not supported.

`>=` (greater than or equal) ::
Returns `true` if the value to the left of the operator is greater than or equal
Expand Down Expand Up @@ -370,6 +372,20 @@ use a regular string with the `\"` escape sequence.
"String containing \"\"\" three double quotes"
----

[discrete]
[[eql-syntax-wildcards]]
===== Wildcards

For string comparisons using the `:` operator, you can use wildcards (`*`) to
match specific patterns:

[source,eql]
----
field : "example*wildcard"
field : "*example-wildcard"
field : "example-wildcard*"
----
Comment on lines +375 to +387
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@costin Is there an escape sequence for strings containing a literal asterisk (*)? I tested \*, but that didn't seem to work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not at the moment. It's something we need to discuss.


[discrete]
[[eql-sequences]]
=== Sequences
Expand Down