manifests/collectors/Monitor/LAWorkspaceSavedSearches.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Monitor/LAWorkspaceSavedSearches.ps1 (AB#5660).
# Field expressions are copied verbatim from the original collector and evaluate in an
# equivalent scope -- see docs/design/decisions/declarative-collectors.md.
# Review before trusting; regenerate rather than hand-patch if the source collector changes.
#
@{
    ResourceTypes = @(
        'AZSC/ARMChild/LAWorkspaceSavedSearches'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = @'
$_.properties.category -notlike 'Microsoft*' -and
        $_.id -notlike '*microsoft.operationalinsights/workspaces/microsoft*'
'@


    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ws = $Resources | Where-Object { $_.id -eq $1.PARENTID } | Select-Object -First 1
            $sub1 = $SUB | Where-Object { $_.Id -eq $1.subscriptionId }
            $ResUCount = 1
            $props = $1.properties
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'Workspace Name'
            Expression = '$ws.NAME'
        }
        @{
            Name = 'Subscription'
            Expression = '$sub1.Name'
        }
        @{
            Name = 'Resource Group'
            Expression = '$ws.RESOURCEGROUP'
        }
        @{
            Name = 'Search ID'
            Expression = '$1.id'
        }
        @{
            Name = 'Display Name'
            Expression = 'if ($props.displayName) { $props.displayName } else { $1.name }'
        }
        @{
            Name = 'Category'
            Expression = 'if ($props.category) { $props.category } else { ''N/A'' }'
        }
        @{
            Name = 'Query'
            Expression = 'if ($props.query) { $props.query.Substring(0, [Math]::Min($props.query.Length, 250)) } else { '''' }'
        }
        @{
            Name = 'Version'
            Expression = 'if ($props.version) { $props.version } else { 1 }'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
        @{
            Name = 'Tag Name'
            Expression = ''''''
        }
        @{
            Name = 'Tag Value'
            Expression = ''''''
        }
    )

    Export = @{
        WorksheetName = 'LA Saved Searches'
        TableNamePrefix = 'LASavedSearchTable_'
        Columns = @(
            'Workspace Name'
            'Subscription'
            'Resource Group'
            'Display Name'
            'Category'
            'Query'
            'Version'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

    SourceCollector = 'Modules/Public/InventoryModules/Monitor/LAWorkspaceSavedSearches.ps1'
}