The case-insensitive contains string operator

Learn how to use the contains operator to filter a record set for data containing a case-insensitive string.

Filters a record set for data containing a case-insensitive string. contains searches for arbitrary sub-strings rather than terms.

Performance tips

When possible, use contains_cs - a case-sensitive version of the operator.

If you’re looking for a term, use has for faster results.

Syntax

T | where col contains_cs (string)

Parameters

NameTypeRequiredDescription
Tstring✔️The tabular input whose records are to be filtered.
colstring✔️The name of the column to check for string.
stringstring✔️The case-sensitive string by which to filter the data.

Returns

Rows in T for which string is in col.

Example

StormEvents
| summarize event_count=count() by State
| where State contains "enn"
| where event_count > 10
| project State, event_count
| render table

Output

Stateevent_count
PENNSYLVANIA1687
TENNESSEE1125