Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rusnakpe
Contributor II
Contributor II

Qlik CLI filtering for automations by ownerId attribute

Hi all,

fighting with listing all automation for given owner and I could not find any proper documentation how to use --filter option for automations. Only Qlik CLI help within powershell which is not enough.

Filtering through these attributes should be possible: name, runMode, lastRunStatus, ownerId

qlik automation ls --filter 'ownerId eq 64ec602e1fa6aadd5ef3b73e' 

This works for me without an error, but if I check ownerId in output of that command can see different ownerId compared to I used within command above. For some users works well for some does not.

Anyone here has some experience pls?

Thank you!

Labels (2)
6 Replies
Levi_Turner
Employee
Employee

Like so:

qlik automation ls --filter "ownerId eq ""VQGmdk0qDy1E_yhK7TNsa30s1Cj0QK6n"""

 

 

rusnakpe
Contributor II
Contributor II
Author

Hi @Levi_Turner , thanks for reply. Not working. I forgot to mention that I tried many versions with single/double quotes, but without any effect. As the command gives me result, but bad one with differen ownerId I suppose it might be defect...

Levi_Turner
Employee
Employee

My first post runs fine for me on Windows. You didn't specify the terminal that you're using, but on Mac, this is working:

qlik automation ls --filter "ownerId eq \"VQGmdk0qDy1E_yhK7TNsa30s1Cj0QK6n\""
rusnakpe
Contributor II
Contributor II
Author

Using Qlik CLI in powershell downloaded latest from github Releases · qlik-oss/qlik-cli (github.com). So basically, I think I have it working, but I am not sure whether the filter part is correct as I often get different output then expected, see below lines....

@Levi_Turner did you check the ouptut? That used ownerId is the same as ownerId within the output? Why I am asking is the fact, that sometime works for me and it gives me all automations for given ownerId, but sometimes it gives me different ownerId's automations in output than I used in filter param of the command. Very weird behavior. I checked 3 ownerIds - 1 was working fine and 2 was not working fine - checked against Management console list of automations.....

Levi_Turner
Employee
Employee

Not when I posted, but I just did. Everything seems fine. Validation code:

 

$automations = qlik automation ls --limit 1000 | ConvertFrom-Json
$owners = $automations.ownerId
$owners = $owners | Select -Unique
$automation_owners_detail = @()
foreach($owner in $owners) {
	$tmp = (qlik automation ls --filter "ownerId eq ""$owner""" --limit 1000 | ConvertFrom-Json)
	$automation_owners_detail += $tmp
}
$automations | Export-Csv .\automations.csv
$automation_owners_detail  | Export-Csv .\automation_owner_details.csv

 

 

Manually interrogating the two CSVs shows the same counts, same automation names, same automation ids:

Levi_Turner_1-1711633969767.png

 

 

rusnakpe
Contributor II
Contributor II
Author

Hi @Levi_Turner thanks for verification. I run the same command in cmd then in powershell and I got different results for the same query for the same context used.

Command line was working fine and filter works as expected. Powershell command gave me different ownerId even the command run without any error.