Skip to content

Conversation

@jrodewig
Copy link
Contributor

@jrodewig jrodewig commented Apr 8, 2020

Documents the EQL stringContains function.

Relates to #54380 and #54136

@jrodewig jrodewig added >docs General docs changes :Analytics/EQL EQL querying labels Apr 8, 2020
@jrodewig jrodewig requested a review from aleksmaus April 8, 2020 17:03
@elasticmachine
Copy link
Collaborator

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

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (>docs)

stringContains("start regsvr32.exe", "") // returns false
// null handling
stringContains(null, "regsvr32") // returns null
Copy link
Contributor

@rw-access rw-access Apr 9, 2020

Choose a reason for hiding this comment

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

Based off the conversation today, null in any required input will lead to a null output

Suggested change
stringContains(null, "regsvr32") // returns null
stringContains(null, "regsvr32") // returns null
stringContains(process.command_line, null) // returns null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Updated with 8bcb8f8.

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.
Suggested, also, another example to add.

// process.command_line = "start regsvr32.exe"
stringContains(process.command_line, "regsvr32") // returns true
stringContains(process.command_line, "start ") // returns true
stringContains(process.command_line, "explorer") // returns false
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add one additional example, to show a less obvious usage: stringContains(process.path, process.name).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added with 5ccc198. Thanks!

@jrodewig jrodewig merged commit cde5fc1 into elastic:master Apr 24, 2020
@jrodewig jrodewig deleted the docs__eql-fn-stringcontains branch April 24, 2020 18:53
@jrodewig
Copy link
Contributor Author

Backport commits

master cde5fc1
7.x 5981412

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.

4 participants