startsWith
startsWith
✓ BooleanCheck if a string begins with the given prefix as a case-sensitive match
startsWith(string, prefix) → boolean boolean true if string starts with prefix, false otherwise; null if either input is null
Edge Cases
Section titled “Edge Cases”- If
stringisnull, returnsnull - If
prefixisnull, returnsnull - Empty prefix
""matches any string (returnstrue) - Search is case-sensitive:
startsWith("Production", "prod")returnsfalse
Examples
Section titled “Examples”| where startsWith(message, "Error:")
Matches records where message starts with “Error:”.
| eval is_api_call = startsWith(request_path, "/api/")
Creates a boolean field is_api_call that is true if request_path starts with “/api/”.
| where startsWith(hostname, "prod-")
Filters to production hostnames only.