Home / Search/ Language Reference/ Operators/ String Operators/!hasprefix

!hasprefix

The !hasprefix operator applies a case-insensitive starting string filter and excludes events that match. Any of the words in the string can have the prefix.

The following table compares the hasprefix operators using these abbreviations:

  • RHS = right-hand side of the expression
  • LHS = left-hand side of the expression
OperatorDescriptionCase-SensitiveExample (yields true)
hasprefixRHS is a term prefix in LHSNo"North America" hasprefix "ame"
!hasprefixRHS isn’t a term prefix in LHSNo"North America" !hasprefix "mer"
hasprefix_csRHS is a term prefix in LHSYes"North America" hasprefix_cs "Ame"
!hasprefix_csRHS isn’t a term prefix in LHSYes"North America" !hasprefix_cs "CA"

Syntax

    Scope | where Field !hasprefix Expression

Arguments

  • Scope: The input tabular result set to filter.
  • Field: The field to filter.
  • Expression: The expression for which to search.

Example

dataset=myDataset 
| summarize Events=count() by State
| where State !hasprefix "N"