Forum Discussion

ScottAllison's avatar
ScottAllison
Iron Contributor
Feb 10, 2020
Solved

query multiple "contains"

Greetings Community,   I'm trying to come up with a way to query for multiple computers, but I have different strings to search for. For example: Heartbeat | where TimeGenerated >= ago(1h) | w...
  • CliveWatson's avatar
    CliveWatson
    Feb 10, 2020

    ScottAllison 

     

    Sorry for being slow on the uptake, string is the search criteria (or pattern match you want) within the computer name column? e.g.

    Heartbeat
    | extend CompBucket = case(Computer contains "aks", Computer, 
                               Computer contains "Con", Computer
                               ,"")
    | where isnotempty(CompBucket)

     

    or 

     

     

    Heartbeat
    | where Computer contains "aks" 
         or Computer contains "Con"
    | project Computer

Resources