The case-insensitive hassuffix string operator

Learn how to use the hassuffix operator to filter data with a case-insensitive suffix string.

Filters a record set for data with a case-insensitive ending string. hassuffix returns true if there is a term inside the filtered string column ending with the specified string expression.

Performance tips

When possible, use the case-sensitive hassuffix_cs.

Syntax

T | where Column hassuffix (Expression)

Parameters

NameTypeRequiredDescription
TstringThe tabular input whose records are to be filtered.
ColumnstringThe column by which to filter.
ExpressionscalarThe scalar or literal expression for which to search.

Returns

Rows in T for which the predicate is true.

Example

StormEvents
| summarize event_count=count() by State
| where State hassuffix "th"
| project State, event_count

Output

Stateevent_count
NORTH CAROLINA1721
SOUTH DAKOTA1567
SOUTH CAROLINA915
NORTH DAKOTA905
ATLANTIC SOUTH193
ATLANTIC NORTH188