File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Modules/CIPPCore/Public/Entrypoints Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ function Invoke-ListLogs {
5858 $PartitionKey = $Request.Query.DateFilter
5959 $username = $Request.Query.User ?? ' *'
6060 $TenantFilter = $Request.Query.Tenant
61+ $ApiFilter = $Request.Query.API
6162
6263 $StartDate = $Request.Query.StartDate ?? $Request.Query.DateFilter
6364 $EndDate = $Request.Query.EndDate ?? $Request.Query.DateFilter
@@ -87,7 +88,8 @@ function Invoke-ListLogs {
8788 $Rows = Get-AzDataTableEntity @Table - Filter $Filter | Where-Object {
8889 $_.Severity -in $LogLevel -and
8990 $_.Username -like $username -and
90- ($TenantFilter -eq $null -or $TenantFilter -eq ' AllTenants' -or $_.Tenant -like " *$TenantFilter *" -or $_.TenantID -eq $TenantFilter )
91+ ($TenantFilter -eq $null -or $TenantFilter -eq ' AllTenants' -or $_.Tenant -like " *$TenantFilter *" -or $_.TenantID -eq $TenantFilter ) -and
92+ ($ApiFilter -eq $null -or $_.API -match " $ApiFilter " )
9193 }
9294
9395 if ($AllowedTenants -notcontains ' AllTenants' ) {
@@ -122,8 +124,8 @@ function Invoke-ListLogs {
122124 }
123125
124126 return [HttpResponseContext ]@ {
125- StatusCode = [HttpStatusCode ]::OK
126- Body = @ ($ReturnedLog | Sort-Object - Property DateTime - Descending)
127- }
127+ StatusCode = [HttpStatusCode ]::OK
128+ Body = @ ($ReturnedLog | Sort-Object - Property DateTime - Descending)
129+ }
128130
129131}
You can’t perform that action at this time.
0 commit comments