Skip to content

[DOCS] EQL: Document endsWith function #54521

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

Merged
merged 2 commits into from
Apr 1, 2020
Merged

[DOCS] EQL: Document endsWith function #54521

merged 2 commits into from
Apr 1, 2020

Conversation

jrodewig
Copy link
Contributor

Adds documentation for the EQL endsWith function.

Relates to #54442.

@jrodewig jrodewig added >docs General docs changes :Analytics/EQL EQL querying labels Mar 31, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (>docs)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (:Query Languages/EQL)

@jrodewig jrodewig requested a review from astefan March 31, 2020 16:44
Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM in general. Left one comment that should be valid for other string functions, as well. Thank you.

(Required, string or `null`)
Source string. If `null`, the function returns `null`.
+
If using a field as the argument, this parameter only supports the
Copy link
Contributor

Choose a reason for hiding this comment

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

With this PR I realized one small aspect here. It should be valid for all other string functions, though.
One can use a text field in the function and there won't be any exception and the query will work if that text field will have a keyword sub-field.

For example, the following mapping

        "hostname" : {
            "type" : "text",
            "fields" : {
                "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                }
            }
        }

and the query process where endsWith(hostname, "foo") == true won't trigger an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Valid statement for the other parameter, as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks again for pointing this out. Addressed with 508be06.

[[eql-fn-endswith]]
=== `endsWith`

Returns `true` if a source string ends with a provided substring.
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is case insensitive, as well. And I believe it's worth being mentioned in docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Addressed with 508be06.

@jrodewig jrodewig merged commit e86e148 into elastic:master Apr 1, 2020
@jrodewig jrodewig deleted the docs__eql-fn-endswith branch April 1, 2020 14:28
jrodewig added a commit that referenced this pull request Apr 1, 2020
@jrodewig
Copy link
Contributor Author

jrodewig commented Apr 1, 2020

Backport commits

master e86e148
7.x b43eb5a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/EQL EQL querying >docs General docs changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants