How do I extract the filter field from Azure Resource Graph Explorer

AndyD 25 Reputation points
2024-10-08T15:04:50.06+00:00

Using Azure Resource Graph Explorer I am trying to extract fields from the properties column in the maintenanceresources table.

I can extract properties.maintenanceConfigurationId and properties.resourceId however I cannot extract properties.filter as if "filter" is a disallowed word

maintenanceresources | project properties.filter

gives a parser failure.

Anyone got any ideas how to extract this field ?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,285 questions
0 comments No comments
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 24,376 Reputation points MVP
    2024-10-09T06:43:59.6766667+00:00

    Hi,

    Here is a query that gets all such resources that have filter property in properties. Note that some resources do not have it if they are assigned directly to a resource instead of being dynamic scope. The filter is put into its own property.

    maintenanceresources
    | where bag_has_key(properties, 'filter')
    | extend Filter = parse_json(tostring(properties.['filter']))
    

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.