endsWith
endsWith
✓ BooleanCheck if a string ends with the given suffix as a case-sensitive match
endsWith(string, suffix) → boolean boolean true if string ends with suffix, false otherwise; null if either input is null
Edge Cases
Section titled “Edge Cases”- If
stringisnull, returnsnull - If
suffixisnull, returnsnull - Empty suffix
""matches any string (returnstrue) - Search is case-sensitive:
endsWith("Production", "tion")returnsfalse
Examples
Section titled “Examples”| where endsWith(filename, ".log")
Matches records where filename ends with “.log”.
| eval is_json_file = endsWith(filename, ".json")
Creates a boolean field is_json_file that is true if the filename ends with “.json”.
| where endsWith(message, "success")
Filters to messages that indicate success.