Forum Discussion
deepak198486
Apr 23, 2021Copper Contributor
i am trying to fetch the machine list which does not contain letter " l " in 8th position.
I am trying to fetch the machine list which does not contain letter " l " in 8th position.
can i use Kusto regex to achieve this. I only see matches regex command.
- GaryBusheyBronze Contributor
deepak198486 There is the indexof_regex command (indexof_regex() - Azure Data Explorer | Microsoft Docs) that could work
- deepak198486Copper ContributorI have the regex which identifies it and get the results but i want the results not matching the regex. Is there any command or function to achieve this
- JBUB_AcceleryntBrass Contributor
Can you post the complete query? We will be able to help.
Have you tried using the "| where not" xxxxxxx feature?
- deepak198486Copper ContributorThanks
I used the not operator and it worked.
Meanwhile below is the query
SecurityRecommendation
| where RecommendationName == "Disk encryption should be applied on virtual machines"
| where RecommendationState in ("NotApplicable", "Unhealthy")
| extend field = split(AssessedResourceId, '/')
| extend VM = tostring(field[8])
| extend resourceGroups = tostring(field[4])
| extend subscriptions = tostring(field[2])
| where not(VM matches regex "^.......[l].*") == true
| project VM, RecommendationDisplayName, resourceGroups, subscriptions, TimeGenerated
| extend HostCustomEntity = VM