Like most of the other programming and query languages, Kusto too has sense of case sensitivity, which means, it can deal with upper-case and lower-case while performing comparisons between values.
Let’s consider below sample data:
Case Sensitive Comparison
The Case sensitive means match should be exact, upper-case letter must match with upper-case only and same for lower-case. Whenever the match is performed between an upper-case character and a lower-case character, query would return false, although both the characters are same. For example, dev and Dev are not same.
Get list of features, which belongs to dev environment.
Case Insensitive Comparison
Now, to achieve this behavior there are multiple approaches.
In this approach, one can first convert the string using toupper(…) or tolower(…) functions and then perform the comparison as shown below:
In this approach, no need to call any extra function as inbuild operator will do this for us as shown below:
Execution of both the above queries result in same output as shown below:
- Always prefer case-sensitive over case-insensitive, wherever possible.
- Always prefer has or in over contains.
- Avoid using short strings as it impacts indexing.