This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Commands

Ctrl-Q commands.

List available commands

If unsure about which command to use, run ctrl-q help to get a list of commands available in the Ctrl-Q version you are using.

Using Windows Terminal/PowerShell:

.\ctrl-q.exe help

Using macOS/Linux:

./ctrl-q help
Usage: ctrl-q [options] [command]

Ctrl-Q is a command line utility for interacting with client-managed Qlik Sense Enterprise on Windows servers.
Among other things the tool does bulk import of apps and tasks, manipulates master items and scrambles in-app data.

Version: 4.0.0

Options:
  -V, --version   output the version number
  -h, --help      display help for command

Commands:
  help [command]  display help for command
  qscloud
  qseow

The help command and --help option can both be used to get more information about a command.

For example, to get more information about the qseow command, either of these commands can be used (Windows):

  • .\ctrl-q.exe help qseow
  • .\ctrl-q.exe qseow --help
Usage: ctrl-q qseow [options] [command]

Options:
  -h, --help                                display help for command

Commands:
  user-activity-bucket-cp-create [options]  create custom property and populate it with values ("activity buckets") indicating how long ago users last logged into Sense
  master-item-import [options]              create master items based on definitions in a file on disk
  master-item-measure-get [options]         get info about one or more master measures
  master-item-measure-delete [options]      delete master measure(s)
  master-item-dim-get [options]             get info about one or more master dimensions
  master-item-dim-delete [options]          delete master dimension(s)
  variable-get [options]                    get variable definitions in one or more apps
  variable-delete [options]                 delete one or more variables in one or more apps
  field-scramble [options]                  scramble one or more fields in an app. A new app with the scrambled data is created.
  script-get [options]                      get script from Qlik Sense app
  bookmark-get [options]                    get info about one or more bookmarks
  task-get [options]                        get info about one or more tasks
  task-custom-property-set [options]        update a custom property of one or more tasks
  task-import [options]                     create tasks based on definitions in a file on disk, optionally also importing apps from QVF files.
  app-import [options]                      import apps/upload QVF files on disk to Sense based on definitions in Excel file.
  app-export [options]                      export Qlik Sense apps to QVF files on disk.
  connection-test [options]                 test connection to Qlik Sense server.
  version [options]                         show version info
  task-vis [options]                        visualise task network
  session-get [options]                     get info about proxy sessions on one or more virtual proxies
  session-delete [options]                  delete proxy session(s) on a specific virtual proxy and proxy service
  help [command]                            display help for command

1 - Client-managed Qlik Sense commands

Client-managed Qlik Sense commands.

1.1 - App scripts

Manage Qlik Sense app scripts

Page contents:


Get app script

Get script and associated metadata for a Sense app.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow script-get --help
Usage: ctrl-q qseow script-get [options]

get script from Qlik Sense app

Options:
  --log-level <level>               log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                     Qlik Sense server IP/FQDN
  --port <port>                     Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>         Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                     Qlik Sense app ID
  --open-without-data <true|false>  open app without data (choices: "true", "false", default: "true")
  --virtual-proxy <prefix>          Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>             https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>       user directory for user to connect with
  --auth-user-id <userid>           user ID for user to connect with
  -a, --auth-type <type>            authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>           Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>       Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>      Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>                  JSON Web Token (JWT) to use for authentication with Qlik Sense server
  -h, --help                        display help for command

Example

.\ctrl-q.exe qseow script-get `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
  --auth-user-dir LAB `
  --auth-user-id goran
2024-11-15T14:21:19.066Z info: -----------------------------------------------------------
2024-11-15T14:21:19.070Z info: | Ctrl-Q
2024-11-15T14:21:19.071Z info: |
2024-11-15T14:21:19.071Z info: | Version      : 4.0.0
2024-11-15T14:21:19.071Z info: | Log level    : info
2024-11-15T14:21:19.071Z info: |
2024-11-15T14:21:19.071Z info: | Command      : script-get
2024-11-15T14:21:19.071Z info: |              : get script from Qlik Sense app
2024-11-15T14:21:19.071Z info: |
2024-11-15T14:21:19.073Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T14:21:19.073Z info: |
2024-11-15T14:21:19.073Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T14:21:19.073Z info: ----------------------------------------------------------
2024-11-15T14:21:19.073Z info:
2024-11-15T14:21:20.137Z info: ----- Script metadata -----
2024-11-15T14:21:20.137Z info: App id: a3e0f5d2-000a-464f-998d-33d333b175d7
2024-11-15T14:21:20.137Z info: Created date: 2021-06-03T22:04:52.283Z
2024-11-15T14:21:20.138Z info: Modified date: 2024-03-20T08:02:25.153Z
2024-11-15T14:21:20.138Z info: ----- End script metadata -----
///$tab Main
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
SET CreateSearchIndexOnReload=1;
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';

Characters:
Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;

ASCII:
Load
 if(RecNo()>=65 and RecNo()<=90,RecNo()-64) as Num,
 Chr(RecNo()) as AsciiAlpha,
 RecNo() as AsciiNum
autogenerate 255
 Where (RecNo()>=32 and RecNo()<=126) or RecNo()>=160 ;

Transactions:
Load
 TransLineID,
 TransID,
 mod(TransID,26)+1 as Num,
 Pick(Ceil(3*Rand1),'A','B','C') as Dim1,
 Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Dim2,
 Pick(Ceil(3*Rand()),'X','Y','Z') as Dim3,
 Round(1000*Rand()*Rand()*Rand1) as Expression1,
 Round(  10*Rand()*Rand()*Rand1) as Expression2,
 Round(Rand()*Rand1,0.00001) as Expression3;
Load
 Rand() as Rand1,
 IterNo() as TransLineID,
 RecNo() as TransID
Autogenerate 1000
 While Rand()<=0.5 or IterNo()=1;

 Comment Field Dim1 With "This is a field comment";



let var1 = 'This is variable 1';
let var2 = 1234;


// Dummy country data.
// Courtesty of Bing AI chat "please give me an inline qlik sense table with countries in it"
LOAD * INLINE [
Country, Population
Afghanistan, 38,928,346
Albania, 2,877,797
Algeria, 43,851,044
Andorra, 77,265
Angola, 32,866,272
];

1.2 - Bookmarks

Page contents:


List bookmarks in a Sense app

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow bookmark-get --help
Usage: ctrl-q qseow bookmark-get [options]

get info about one or more bookmarks

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                 Qlik Sense app ID
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --id-type <type>              type of bookmark identifier passed in the --bookmark option (choices: "id", "name", default: "name")
  --bookmark <bookmarks...>     bookmark to retrieve. If not specified all bookmarks will be retrieved
  --output-format <json|table>  output format (default: "json")
  -h, --help                    display help for command

Example

.\ctrl-q.exe qseow bookmark-get `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
  --output-format table `
  --auth-user-dir LAB `
  --auth-user-id goran
2024-11-15T14:28:18.202Z info: -----------------------------------------------------------
2024-11-15T14:28:18.205Z info: | Ctrl-Q
2024-11-15T14:28:18.205Z info: |
2024-11-15T14:28:18.205Z info: | Version      : 4.0.0
2024-11-15T14:28:18.205Z info: | Log level    : info
2024-11-15T14:28:18.206Z info: |
2024-11-15T14:28:18.206Z info: | Command      : bookmark-get
2024-11-15T14:28:18.206Z info: |              : get info about one or more bookmarks
2024-11-15T14:28:18.206Z info: |
2024-11-15T14:28:18.207Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T14:28:18.207Z info: |
2024-11-15T14:28:18.207Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T14:28:18.207Z info: ----------------------------------------------------------
2024-11-15T14:28:18.207Z info:
2024-11-15T14:28:18.211Z info: Get bookmarks
2024-11-15T14:28:19.351Z info: Bookmarks
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Bookmarks (1 bookmark(s) found in the app)                                                                                                                                                                                                                                                               │
├──────────────────────────────────────┬──────────┬───────────┬─────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┬───────────┬──────────────────────────┬──────────────────────────┬──────────────────────────┬───────────┤
│ Id                                   │ Type     │ Title     │ Description     │ Bookmark definition                                                                                  │ Approved │ Published │ Publish time             │ Created date             │ Modified date            │ Owner     │
├──────────────────────────────────────┼──────────┼───────────┼─────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┤
│ 81ec0c0d-c90c-431b-8c19-eff4048de404 │ bookmark │ Bookmark1 │ BM1 description │ {"qStateData":[{"qStateName":"$","qFieldItems":[{"qDef":{"qName":"Dim1","qType":"PRESENT"},"qSelectI │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2021-07-06T15:09:38.565Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │
│                                      │          │           │                 │ nfo":{"qRangeLo":"NaN","qRangeHi":"NaN","qNumberFormat":{"qType":"U","qnDec":10,"qUseThou":0},"qRang │          │           │                          │                          │                          │           │
│                                      │          │           │                 │ eInfo":[],"qContinuousRangeInfo":[]},"qValues":[],"qExcludedValues":[]}]}],"qUtcModifyTime":44383.71 │          │           │                          │                          │                          │           │
│                                      │          │           │                 │ 498842593,"qVariableItems":[],"qPatches":[],"qCyclicGroupStates":[],"qGroupStates":[]}               │          │           │                          │                          │                          │           │
└──────────────────────────────────────┴──────────┴───────────┴─────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┴───────────┴──────────────────────────┴──────────────────────────┴──────────────────────────┴───────────┘

1.3 - Connection test

Command to test connection to client-mnaged Qlik Sense server.

Page contents:


Test connection to Qlik Sense server

Some of the Ctrl-Q commands are rather complex and it can be difficult to figure out what is wrong if the command fails.

To rule out any connection issues between the machine running Ctrl-Q and the Qlik Sense server it is possible to run the connection-test command.

Here you learn how that command is executed using certificate authentication, using the default certificates, port (for connecting to QRS using certificates) and virtual proxy.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow connection-test --help
Usage: ctrl-q qseow connection-test [options]

test connection to Qlik Sense server.

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense proxy service port (default: "4242")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  -h, --help                    display help for command

Example

.\ctrl-q.exe qseow connection-test `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran
2024-11-15T14:34:03.752Z info: -----------------------------------------------------------
2024-11-15T14:34:03.757Z info: | Ctrl-Q
2024-11-15T14:34:03.757Z info: |
2024-11-15T14:34:03.757Z info: | Version      : 4.0.0
2024-11-15T14:34:03.757Z info: | Log level    : info
2024-11-15T14:34:03.758Z info: |
2024-11-15T14:34:03.758Z info: | Command      : connection-test
2024-11-15T14:34:03.759Z info: |              : test connection to Qlik Sense server.
2024-11-15T14:34:03.759Z info: |
2024-11-15T14:34:03.759Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T14:34:03.760Z info: |
2024-11-15T14:34:03.760Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T14:34:03.760Z info: ----------------------------------------------------------
2024-11-15T14:34:03.760Z info:
2024-11-15T14:34:03.763Z info: Testing connection to Qlik Sense server pro2-win1.lab.ptarmiganlabs.net on port 4242
2024-11-15T14:34:04.187Z info: Successfully connected to Qlik Sense server pro2-win1.lab.ptarmiganlabs.net on port 4242
2024-11-15T14:34:04.187Z info: Qlik Sense repository build version: 31.43.0.0
2024-11-15T14:34:04.188Z info: Qlik Sense repository build date: 4/12/2024 18:12:20 PM

1.4 - Custom properties

Commands to retrieve and manipulate custom properties.

Page contents:


Set custom property of reload task

Setting custom properties of reload tasks can be very time consuming if there are lots of tasks and/or custom propertis.
Ctrl-Q makes it possible to update many takes at once with a single command.

Note:

  1. ONE custom property can be updated each time Ctrl-Q is executed.
    If several custom properties should be updated Ctrl-Q must be started several times.
  2. The custom property to be updated must exist before Ctrl-Q is executed. Create the custom property in the QMC first.
  3. The custom property values to be set must exist before Ctrl-Q is executed. Create the custom property in the QMC first.
  4. Task IDs and task tags can be useed to specifiy which tasks’ custom properties should be updated.
    1. The --task-id and --task-tag options are additive, i.e. the union of tasks matching the task IDs and tags will be updated.
  5. The --update-mode option controls how custom properties are updated.
    1. Setting the option to append will add the specified values to any other values already set for the custom property.
    2. Setting the option to replace will delete any already set values for the custom property and then add the specified values.

In the example below 5 tasks will be updated: 3 based on task IDs and 2 based on the task tag “apiCreated”.
The values “Finance” and “Sales” will be added to the custom property “Department”.
Existing custom property values are preserved (i.e. the new values are appended to any already existing values) by appending new values rather than replacing (--update-mode append option).
If a task already has values for this custom property new values will be added without asking first (--overwrite option)

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow task-custom-property-set --help
Usage: ctrl-q qseow task-custom-property-set [options]

update a custom property of one or more tasks

Options:
  --log-level <level>                  log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                        Qlik Sense server IP/FQDN
  --port <port>                        Qlik Sense repository service (QRS) port (usually 4242 for cert auth, 443 for jwt auth) (default: "4242")
  --schema-version <string>            Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>             Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>                https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>          user directory for user to connect with
  --auth-user-id <userid>              user ID for user to connect with
  -a, --auth-type <type>               authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>              Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>          Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>         Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>                     JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --task-type <type...>                type of tasks to list (choices: "reload", default: ["reload"])
  --task-id <ids...>                   use task IDs to select which tasks to retrieve
  --task-tag <tags...>                 use tags to select which tasks to retrieve
  --custom-property-name <name>        name of custom property that will be updated
  --custom-property-value <values...>  one or more values name of custom property that will be updated
  --overwrite                          overwrite existing custom property values without asking
  --update-mode <mode>                 append or replace value(s) to existing custom property (choices: "append", "replace", default: "append")
  --dry-run                            do a dry run, i.e. do not modify any reload tasks - just show what would be updated
  -h, --help                           display help for command

Example

.\ctrl-q.exe qseow task-custom-property-set `
   --auth-type cert `
   --host pro2-win1.lab.ptarmiganlabs.net `
   --auth-user-dir LAB `
   --auth-user-id goran `
   --task-id 82bc3e66-c899-4e44-b52f-552145da5ee0 5748afa9-3abe-43ab-bb1f-127c48ced075 5520e710-91ad-41d2-aeb6-434cafbf366b `
   --task-tag 'apiCreated' `
   --custom-property-name Department `
   --custom-property-value Finance Sales `
   --overwrite `
   --update-mode append
2024-11-15T14:38:18.983Z info: -----------------------------------------------------------
2024-11-15T14:38:18.986Z info: | Ctrl-Q
2024-11-15T14:38:18.987Z info: |
2024-11-15T14:38:18.987Z info: | Version      : 4.0.0
2024-11-15T14:38:18.987Z info: | Log level    : info
2024-11-15T14:38:18.988Z info: |
2024-11-15T14:38:18.988Z info: | Command      : task-custom-property-set
2024-11-15T14:38:18.988Z info: |              : update a custom property of one or more tasks
2024-11-15T14:38:18.988Z info: |
2024-11-15T14:38:18.989Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T14:38:18.989Z info: |
2024-11-15T14:38:18.989Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T14:38:18.989Z info: ----------------------------------------------------------
2024-11-15T14:38:18.989Z info:
2024-11-15T14:38:19.619Z info: Number of tasks that will be updated: 5
2024-11-15T14:38:19.619Z info:
2024-11-15T14:38:19.619Z info: -----------------------------------------------------------
2024-11-15T14:38:19.620Z info: Processing task "Reload of Test data - Seattle checkouts by title3" with ID=82bc3e66-c899-4e44-b52f-552145da5ee0
2024-11-15T14:38:19.621Z info: Starting updating custom property "Department" of task "Reload of Test data - Seattle checkouts by title3" with ID=82bc3e66-c899-4e44-b52f-552145da5ee0
2024-11-15T14:38:19.969Z info:    ...Custom property "Department" on task "Reload of Test data - Seattle checkouts by title3" successfully updated.
2024-11-15T14:38:19.970Z info:
2024-11-15T14:38:19.970Z info: -----------------------------------------------------------
2024-11-15T14:38:19.970Z info: Processing task "Reload task of Lab 1_1" with ID=5748afa9-3abe-43ab-bb1f-127c48ced075
2024-11-15T14:38:19.971Z info: Starting updating custom property "Department" of task "Reload task of Lab 1_1" with ID=5748afa9-3abe-43ab-bb1f-127c48ced075
2024-11-15T14:38:20.206Z info:    ...Custom property "Department" on task "Reload task of Lab 1_1" successfully updated.
2024-11-15T14:38:20.206Z info:
2024-11-15T14:38:20.206Z info: -----------------------------------------------------------
2024-11-15T14:38:20.206Z info: Processing task "Reload of Test data - Seattle library checkouts & collection inventory" with ID=5520e710-91ad-41d2-aeb6-434cafbf366b
2024-11-15T14:38:20.206Z info: Starting updating custom property "Department" of task "Reload of Test data - Seattle library checkouts & collection inventory" with ID=5520e710-91ad-41d2-aeb6-434cafbf366b
2024-11-15T14:38:20.434Z info:    ...Custom property "Department" on task "Reload of Test data - Seattle library checkouts & collection inventory" successfully updated.
2024-11-15T14:38:20.434Z info:
2024-11-15T14:38:20.434Z info: -----------------------------------------------------------
2024-11-15T14:38:20.436Z info: Processing task "Reload Operations Monitor" with ID=fbf645f0-0c92-40a4-af9a-6e3eb1d3c35c
2024-11-15T14:38:20.436Z info: Starting updating custom property "Department" of task "Reload Operations Monitor" with ID=fbf645f0-0c92-40a4-af9a-6e3eb1d3c35c
2024-11-15T14:38:20.662Z info:    ...Custom property "Department" on task "Reload Operations Monitor" successfully updated.
2024-11-15T14:38:20.662Z info:
2024-11-15T14:38:20.663Z info: -----------------------------------------------------------
2024-11-15T14:38:20.663Z info: Processing task "Reload task of App ageing" with ID=5217e6b2-65ce-4535-ad2a-37b62e66d12c
2024-11-15T14:38:20.663Z info: Starting updating custom property "Department" of task "Reload task of App ageing" with ID=5217e6b2-65ce-4535-ad2a-37b62e66d12c
2024-11-15T14:38:20.901Z info:    ...Custom property "Department" on task "Reload task of App ageing" successfully updated.

1.5 - Dimensions

In-app master dimension.

Page contents:


List master item dimensions in a Sense app

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow master-item-dim-get --help
Usage: ctrl-q qseow master-item-dim-get [options]

get info about one or more master dimensions

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                 Qlik Sense app ID
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --id-type <type>              type of identifier passed in the --master-item option (choices: "id", "name", default: "name")
  --master-item <ids...>        master dimension to retrieve. If not specified all dimensions will be retrieved
  --output-format <format>      output format (choices: "json", "table", default: "json")
  -h, --help                    display help for command

Example

.\ctrl-q.exe qseow master-item-dim-get `
    --host pro2-win1.lab.ptarmiganlabs.net `
    --auth-user-dir LAB `
    --auth-user-id goran `
    --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
    --output-format table
2024-11-15T14:43:23.988Z info: -----------------------------------------------------------
2024-11-15T14:43:23.991Z info: | Ctrl-Q
2024-11-15T14:43:23.991Z info: |
2024-11-15T14:43:23.991Z info: | Version      : 4.0.0
2024-11-15T14:43:23.991Z info: | Log level    : info
2024-11-15T14:43:23.992Z info: |
2024-11-15T14:43:23.992Z info: | Command      : master-item-dim-get
2024-11-15T14:43:23.992Z info: |              : get info about one or more master dimensions
2024-11-15T14:43:23.992Z info: |
2024-11-15T14:43:23.993Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T14:43:23.993Z info: |
2024-11-15T14:43:23.995Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T14:43:23.995Z info: ----------------------------------------------------------
2024-11-15T14:43:23.995Z info:
2024-11-15T14:43:23.997Z info: Get master dimensions
2024-11-15T14:43:24.886Z info:
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Dimensions (6 dimension(s) found in the app)                                                                                                                                                                                                                                                                                                                                                                                                                            │
├──────────────────────────────────────┬───────────┬─────────────────┬────────────────────────────────┬───────────────────────────────┬────────────────────────┬──────────────────┬──────────────────┬─────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┬──────────┬───────────┬──────────────────────────┬──────────────────────────┬──────────────────────────┬───────────┬────────────────┤
│ Id                                   │ Type      │ Title           │ Description (static)           │ Description (from expression) │ Description expression │ Label expression │ Definition count │ Definition  │ Coloring                                                                                             │ Grouping │ Approved │ Published │ Publish time             │ Created date             │ Modified date            │ Owner     │ Tags           │
├──────────────────────────────────────┼───────────┼─────────────────┼────────────────────────────────┼───────────────────────────────┼────────────────────────┼──────────────────┼──────────────────┼─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼────────────────┤
│ JDWuPK                               │ dimension │ Dimension 2-3-1 │ Description for 2-3-1          │                               │                        │                  │ 3                │ Dim2        │ Dimension color:                                                                                     │ H        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2021-06-07T02:31:02.093Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │ My awesome tag │
│                                      │           │                 │                                │                               │                        │                  │                  │ Dim3        │ {"color":"#ffffff","index":1}                                                                        │          │          │           │                          │                          │                          │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │ Dim1        │                                                                                                      │          │          │           │                          │                          │                          │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │                                                                                                      │          │          │           │                          │                          │                          │           │                │
├──────────────────────────────────────┼───────────┼─────────────────┼────────────────────────────────┼───────────────────────────────┼────────────────────────┼──────────────────┼──────────────────┼─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼────────────────┤
│ cb922a28-ff2d-4d97-a9fd-5d99eae2a490 │ dimension │ Color           │ Color of sold unit             │                               │                        │ ='Unit color'    │ 1                │ UnitColor   │                                                                                                      │ N        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2023-05-09T15:11:34.957Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │ Sales, Color   │
├──────────────────────────────────────┼───────────┼─────────────────┼────────────────────────────────┼───────────────────────────────┼────────────────────────┼──────────────────┼──────────────────┼─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼────────────────┤
│ 3047e493-f24f-4d31-a0fb-6b797874b049 │ dimension │ Salesperson     │ The person who sold the unit.  │                               │                        │ ='Salesperson'   │ 1                │ Salesperson │ Value colors:                                                                                        │ N        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2023-03-08T16:45:26.610Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │ Staff, Sales   │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ {"colors":[{"value":"Afghanistan","baseColor":{"color":"#8a85c6","index":-1}},{"value":"Albania","ba │          │          │           │                          │                          │                          │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ seColor":{"color":"#aaaaaa","index":-1}},{"value":"Algeria","baseColor":{"color":"#a16090","index":9 │          │          │           │                          │                          │                          │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ }}],"nul":{"color":"#c8c7a9","index":16},"oth":{"color":"#ffec6e","index":-1},"pal":null,"single":nu │          │          │           │                          │                          │                          │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ ll,"usePal":true,"autoFill":true}                                                                    │          │          │           │                          │                          │
   │           │                │
├──────────────────────────────────────┼───────────┼─────────────────┼────────────────────────────────┼───────────────────────────────┼────────────────────────┼──────────────────┼──────────────────┼─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼────────────────┤
│ 6f375071-5603-401c-815a-9bd59e02623b │ dimension │ DimDrill        │ Drill-down 1                   │                               │                        │                  │ 3                │ Dim1        │ Dimension color:                                                                                     │ H        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2023-06-05T18:39:33.522Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │ Staff, Color   │
│                                      │           │                 │                                │                               │                        │                  │                  │  Dim2       │ {"color":"#bbbbbb","index":-1}                                                                       │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │  Dim3       │                                                                                                      │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │                                                                                                      │          │          │           │                          │                          │
   │           │                │
├──────────────────────────────────────┼───────────┼─────────────────┼────────────────────────────────┼───────────────────────────────┼────────────────────────┼──────────────────┼──────────────────┼─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼────────────────┤
│ 3ca0998b-2c10-485a-9156-7802cb4a2bfe │ dimension │ Sales month     │ Date in which a unit was sold. │                               │                        │ ='Sales month'   │ 1                │ Month_Sales │ Dimension color:                                                                                     │ N        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2024-03-12T09:31:00.986Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ {"color":"#bbbbbb","index":-1}                                                                       │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │                                                                                                      │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │                                                                                                      │          │          │           │                          │                          │
   │           │                │
├──────────────────────────────────────┼───────────┼─────────────────┼────────────────────────────────┼───────────────────────────────┼────────────────────────┼──────────────────┼──────────────────┼─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼────────────────┤
│ 5940487d-18de-4366-91ad-b061b539b05a │ dimension │ Country         │ Country where a unit was sold. │                               │                        │ ='Country sold'  │ 1                │ Country     │ Dimension color:                                                                                     │ N        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2024-03-12T09:31:00.986Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │ Geo, DimCat1   │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ {"color":"#bbbbbb","index":-1}                                                                       │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │                                                                                                      │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ Value colors:                                                                                        │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ {"colors":[{"value":"Afghanistan","baseColor":{"color":"#8a85c6","index":-1}},{"value":"Albania","ba │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ seColor":{"color":"#aaaaaa","index":-1}},{"value":"Algeria","baseColor":{"color":"#a16090","index":9 │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ }}],"nul":{"color":"#c8c7a9","index":16},"oth":{"color":"#ffec6e","index":-1},"pal":null,"single":nu │          │          │           │                          │                          │
   │           │                │
│                                      │           │                 │                                │                               │                        │                  │                  │             │ ll,"usePal":true,"autoFill":true}                                                                    │          │          │           │                          │                          │
   │           │                │
└──────────────────────────────────────┴───────────┴─────────────────┴────────────────────────────────┴───────────────────────────────┴────────────────────────┴──────────────────┴──────────────────┴─────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┴──────────┴───────────┴──────────────────────────┴──────────────────────────┴──────────────────────────┴───────────┴────────────────┘

Delete master item dimensions in a Sense app

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow master-item-dim-delete --help
Usage: ctrl-q qseow master-item-dim-delete [options]

delete master dimension(s)

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                 Qlik Sense app ID
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --id-type <type>              type of identifier passed in the --master-item option (choices: "id", "name")
  --master-item <ids...>        names or IDs of master dimensions to be deleted. Multiple IDs should be space separated
  --delete-all                  delete all master dimensions
  --dry-run                     do a dry run, i.e. do not delete anything - just show what would be deleted
  -h, --help                    display help for command

Example

.\ctrl-q.exe qseow master-item-dim-delete `
    --host pro2-win1.lab.ptarmiganlabs.net `
    --auth-user-dir LAB `
    --auth-user-id goran `
    --app-id 2933711d-6638-41d4-a2d2-6dd2d965208b `
    --id-type name `
    --master-item 'Country' 'Sales month'
2024-11-19T06:50:04.566Z info: -----------------------------------------------------------
2024-11-19T06:50:04.582Z info: | Ctrl-Q
2024-11-19T06:50:04.582Z info: |
2024-11-19T06:50:04.582Z info: | Version      : 4.1.0
2024-11-19T06:50:04.582Z info: | Log level    : info
2024-11-19T06:50:04.582Z info: |
2024-11-19T06:50:04.582Z info: | Command      : master-item-dim-delete
2024-11-19T06:50:04.582Z info: |              : delete master dimension(s)
2024-11-19T06:50:04.582Z info: |
2024-11-19T06:50:04.582Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T06:50:04.582Z info: |
2024-11-19T06:50:04.582Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T06:50:04.582Z info: ----------------------------------------------------------
2024-11-19T06:50:04.582Z info:
2024-11-19T06:50:04.582Z info: Delete master dimensions
2024-11-19T06:50:05.644Z info: (1/2) Deleted master item dimension "Country", id=638d026b-27a1-49ea-9ba0-6faa18eb21a6 in app "2933711d-6638-41d4-a2d2-6dd2d965208b"
2024-11-19T06:50:05.657Z info: (2/2) Deleted master item dimension "Sales month", id=29aab459-f548-4dbc-ad54-f658d701e8dc in app "2933711d-6638-41d4-a2d2-6dd2d965208b"

Running the same command again and nothing will be deleted:

2024-11-19T06:50:25.475Z info: -----------------------------------------------------------
2024-11-19T06:50:25.475Z info: | Ctrl-Q
2024-11-19T06:50:25.475Z info: |
2024-11-19T06:50:25.475Z info: | Version      : 4.1.0
2024-11-19T06:50:25.475Z info: | Log level    : info
2024-11-19T06:50:25.475Z info: |
2024-11-19T06:50:25.475Z info: | Command      : master-item-dim-delete
2024-11-19T06:50:25.475Z info: |              : delete master dimension(s)
2024-11-19T06:50:25.475Z info: |
2024-11-19T06:50:25.475Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T06:50:25.475Z info: |
2024-11-19T06:50:25.475Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T06:50:25.475Z info: ----------------------------------------------------------
2024-11-19T06:50:25.475Z info:
2024-11-19T06:50:25.475Z info: Delete master dimensions
2024-11-19T06:50:26.115Z warn: Master item dimension "Country" not found
2024-11-19T06:50:26.115Z warn: Master item dimension "Sales month" not found
2024-11-19T06:50:26.115Z warn: No matching master item dimensions found

1.6 - Measures

In-app master measures.

Page contents:


List master item measures in a Sense app

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow master-item-measure-get --help
Usage: ctrl-q qseow master-item-measure-get [options]
                                                                                                                                                                                                                     get info about one or more master measures

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                 Qlik Sense app ID
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --id-type <type>              type of identifier passed in the --master-item option (choices: "id", "name", default: "name")
  --master-item <ids...>        master measure to retrieve. If not specified all measures will be retrieved
  --output-format <format>      output format (choices: "json", "table", default: "json")
  -h, --help                    display help for command

Example

.\ctrl-q.exe qseow master-item-measure-get `
--host pro2-win1.lab.ptarmiganlabs.net `
--auth-user-dir LAB `
--auth-user-id goran `
--app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
--output-format table
2024-11-15T15:33:50.823Z info: -----------------------------------------------------------
2024-11-15T15:33:50.825Z info: | Ctrl-Q
2024-11-15T15:33:50.825Z info: |
2024-11-15T15:33:50.825Z info: | Version      : 4.0.0
2024-11-15T15:33:50.825Z info: | Log level    : info
2024-11-15T15:33:50.827Z info: |
2024-11-15T15:33:50.827Z info: | Command      : master-item-measure-get
2024-11-15T15:33:50.827Z info: |              : get info about one or more master measures
2024-11-15T15:33:50.827Z info: |
2024-11-15T15:33:50.828Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:33:50.828Z info: |
2024-11-15T15:33:50.828Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:33:50.828Z info: ----------------------------------------------------------
2024-11-15T15:33:50.828Z info:
2024-11-15T15:33:50.831Z info: Get master measures
2024-11-15T15:33:51.465Z info:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Measures (6 measure(s) found in the app)                                                                                                                                                                                                                                                                                                                                                                                                                                           │
├──────────────────────────────────────┬─────────┬────────────────────────┬───────────────────────────────────────────────────┬──────────────────┬──────────────────┬──────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────────────────────────┬──────────┬──────────┬───────────┬──────────────────────────┬──────────────────────────┬──────────────────────────┬───────────┬───────────┤
│ Id                                   │ Type    │ Title                  │ Description                                       │ Label            │ Label expression │ Definition           │ Coloring                                                                                             │ Number format                         │ Grouping │ Approved │ Published │ Publish time             │ Created date             │ Modified date            │ Owner     │ Tags      │
├──────────────────────────────────────┼─────────┼────────────────────────┼───────────────────────────────────────────────────┼──────────────────┼──────────────────┼──────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼───────────┤
│ 9d563fc2-ad00-41db-ad15-0f80c522686d │ measure │ Revenue EUR (LY)       │ Revenue during last year.                         │ ='Revenue LY'    │ ='Revenue LY'    │ Sum(Revenue_LY)      │                                                                                                      │ {"qType":"U","qnDec":10,"qUseThou":0} │ N        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2023-05-09T15:18:20.753Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │ Sales, LY │
├──────────────────────────────────────┼─────────┼────────────────────────┼───────────────────────────────────────────────────┼──────────────────┼──────────────────┼──────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────┼──────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼───────────┼───────────┤
│ a260c5a2-21e9-4ce5-92d9-c3e7837e51a2 │ measure │ No. of sold units (LY) │ Number of units sold last year.                   │ ='Sold units LY' │ ='Sold units LY' │ Sum(UnitsInOrder_LY) │ Measure color:                                                                                       │ {"qType":"U","qnDec":10,"qUseThou":0} │ N        │ true     │ true      │ 2024-03-20T08:02:24.735Z │ 2023-05-09T15:18:20.753Z │ 2024-03-20T08:02:25.153Z │ LAB\goran │ Sales, LY │
│                                      │         │                        │                                                   │                  │                  │                      │ {"color":"#8a85c6","index":8}                                                                        │                                       │          │          │           │                          │                          │                          │           │           │
│                                      │         │                        │                                                   │                  │                  │                      │                                                                                                      │                                       │          │          │           │                          │                          │                          │           │           │
│                                      │  

Delete master item measures in a Sense app

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow master-item-measure-delete --help
Usage: ctrl-q qseow master-item-measure-delete [options]
                                                                                                                                                                                                                     delete master measure(s)

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                 Qlik Sense app ID
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --id-type <type>              type of identifier passed in the --master-item option (choices: "id", "name")
  --master-item <ids...>        names or IDs of master measures to be deleted. Multiple IDs should be space separated
  --delete-all                  delete all master measures
  --dry-run                     do a dry run, i.e. do not delete anything - just show what would be deleted
  -h, --help                    display help for command

Example

.\ctrl-q.exe qseow master-item-measure-delete `
--host pro2-win1.lab.ptarmiganlabs.net `
--app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
--auth-user-dir LAB `
--auth-user-id goran `
--id-type name `
--master-item 'Revenue EUR' 'Profit EUR (LY)'
2024-11-15T15:35:23.296Z info: -----------------------------------------------------------
2024-11-15T15:35:23.300Z info: | Ctrl-Q
2024-11-15T15:35:23.300Z info: |
2024-11-15T15:35:23.300Z info: | Version      : 4.0.0
2024-11-15T15:35:23.300Z info: | Log level    : info
2024-11-15T15:35:23.301Z info: |
2024-11-15T15:35:23.301Z info: | Command      : master-item-measure-delete
2024-11-15T15:35:23.301Z info: |              : delete master measure(s)
2024-11-15T15:35:23.302Z info: |
2024-11-15T15:35:23.302Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:35:23.302Z info: |
2024-11-15T15:35:23.302Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:35:23.302Z info: ----------------------------------------------------------
2024-11-15T15:35:23.303Z info:
2024-11-15T15:35:23.306Z info: Delete master measures
2024-11-15T15:35:23.959Z info: (1/2) Deleted master item measure "Revenue EUR", id=db090caf-9acb-4302-9be0-d2251c69c04f in app "a3e0f5d2-000a-464f-998d-33d333b175d7"
2024-11-15T15:35:23.962Z info: (2/2) Deleted master item measure "Profit EUR (LY)", id=60912ed8-116d-451f-b145-52d170d62552 in app "a3e0f5d2-000a-464f-998d-33d333b175d7"

1.7 - Scramble fields

Scramble fields in Sense apps.

Page contents:


Scramble fields in Sense app

Scramble one or more fields in an app using Qlik Sense’s internal scrambling feature.

Note:

  • If more than one field is to be scrambled, the indidivudal field names should be separated by the character or string specified in the --separator option.
  • The entire list of field names (the --fieldname option) should be surrounded by double quotes.
  • A new app with the scrambled data will be created. Specify its name in the --newappname option.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow field-scramble --help
Usage: ctrl-q qseow field-scramble [options]

scramble one or more fields in an app. A new app with the scrambled data is created.                                                                                                                                 
Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                 Qlik Sense app ID
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --field-name <names...>       name of field(s) to be scrambled
  --new-app-name <name>         name of new app that will contain scrambled data
  -h, --help                    display help for command

Example

.\ctrl-q.exe qseow field-scramble `
--host pro2-win1.lab.ptarmiganlabs.net `
--app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
--auth-user-dir LAB `
--auth-user-id goran `
--field-name Expression1 Dim1 AsciiAlpha `
--new-app-name __ScrambledTest1
2024-11-15T15:37:59.296Z info: -----------------------------------------------------------
2024-11-15T15:37:59.301Z info: | Ctrl-Q
2024-11-15T15:37:59.302Z info: |
2024-11-15T15:37:59.302Z info: | Version      : 4.0.0
2024-11-15T15:37:59.302Z info: | Log level    : info
2024-11-15T15:37:59.302Z info: |
2024-11-15T15:37:59.304Z info: | Command      : field-scramble
2024-11-15T15:37:59.304Z info: |              : scramble one or more fields in an app. A new app with the scrambled data is created.
2024-11-15T15:37:59.304Z info: |
2024-11-15T15:37:59.304Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:37:59.304Z info: |
2024-11-15T15:37:59.304Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:37:59.304Z info: ----------------------------------------------------------
2024-11-15T15:37:59.305Z info:
2024-11-15T15:37:59.308Z info: Scramble field
2024-11-15T15:38:00.174Z info: Scrambled field "Expression1"
2024-11-15T15:38:00.181Z info: Scrambled field "Dim1"
2024-11-15T15:38:00.189Z info: Scrambled field "AsciiAlpha"
2024-11-15T15:38:01.238Z info: Scrambled data written to new app "__ScrambledTest1" with app ID: 9f377cd6-ce5b-4756-aa7c-2eb0fa4c7494

1.8 - Sessions

Manage Qlik Sense proxy sessions.

Each time a user connects to a client-managed Qlik Sense server a proxy session is created.
In busy environments with many users the number of proxy sessions can thus grow to a large number.

Knowing which users are connected to the system can be useful for system administrators.
For example, when a server is to be restarted, it’s good to know if there are any active users connected to the system - and if so, who they are.

  • The session-get command lists active proxy sessions for parts of, or the entire, Sense environment.
  • The session-delete command can be used to delete a single or many proxy sessions.

Note: Given how Sense’s proxy API works it is only possible to authenthicate using certificates.
I.e. JWT authentication is not supported.


Page contents:


List proxy sessions

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow session-get --help
Usage: ctrl-q qseow session-get [options]                                                                                                                                                                            
get info about proxy sessions on one or more virtual proxies
                                                                                                                                                                                                                     Options:
  --log-level <level>                  log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                        Qlik Sense host (IP/FQDN) where Qlik Repository Service (QRS) is running
  --qrs-port <port>                    Qlik Sense repository service (QRS) port (usually 4242) (default: "4242")
  --virtual-proxy <prefix>             Qlik Sense virtual proxy prefix to access QRS via (default: "")
  --secure <true|false>                https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --session-virtual-proxy <prefix...>  one or more Qlik Sense virtual proxies to get sessions for
  --host-proxy <host...>               Qlik Sense hosts/proxies (IP/FQDN) to get sessions from. Must match the host names of the Sense nodes
  --qps-port <port>                    Qlik Sense proxy service (QPS) port (usually 4243) (default: "4243")
  --auth-user-dir <directory>          user directory for user to connect with
  --auth-user-id <userid>              user ID for user to connect with
  -a, --auth-type <type>               authentication type (choices: "cert", default: "cert")
  --auth-cert-file <file>              Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>          Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>         Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --output-format <json|table>         output format (default: "json")
  -s, --sort-by <column>               column to sort output table by (choices: "prefix", "proxyhost", "proxyname", "userdir", "userid", "username", default: "prefix")
  -h, --help                           display help for command

Example 1

Let’s first take a look at what proxy sessions are active in a Qlik Sense environment.

.\ctrl-q.exe qseow session-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format table

The command gives us several pieces of information:

  • Information about all proxies in the Qlik Sense environment, including how many virtual proxies are linked to each one.
  • Warnings about some virtual proxies not having any linked proxy services. This is not an error per se, but the virtual proxies will not function given this configuration.
  • Detailed information about all active sessions.

In this example there is a single session active, for user goran in the LAB user directory.

2024-11-19T06:52:24.792Z info: -----------------------------------------------------------
2024-11-19T06:52:24.807Z info: | Ctrl-Q
2024-11-19T06:52:24.807Z info: |
2024-11-19T06:52:24.807Z info: | Version      : 4.1.0
2024-11-19T06:52:24.807Z info: | Log level    : info
2024-11-19T06:52:24.807Z info: |
2024-11-19T06:52:24.807Z info: | Command      : session-get
2024-11-19T06:52:24.807Z info: |              : get info about proxy sessions on one or more virtual proxies
2024-11-19T06:52:24.807Z info: |
2024-11-19T06:52:24.807Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T06:52:24.807Z info: |
2024-11-19T06:52:24.807Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T06:52:24.807Z info: ----------------------------------------------------------
2024-11-19T06:52:24.807Z info:
2024-11-19T06:52:24.807Z info: Get Qlik Sense proxy sessions
2024-11-19T06:52:25.432Z info: Successfully retrieved 29 virtual proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T06:52:25.775Z info: Successfully retrieved 2 proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T06:52:25.791Z info: Available Proxy services.
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Available proxy services.                                                                                 │
│                                                                                                           │
│ Note: The "sessions-get" command will only work correctly if the correct --host parameter is used when ca │
│ lling Ctrl-Q.                                                                                             │
│ The --host parameter should be one of the host names listed below.                                        │
├─────────┬─────────────────────────────────┬──────────────────────────────────────┬────────────────────────┤
│ Name    │ Host name                       │ Id                                   │ Linked virtual proxies │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ Central │ pro2-win1.lab.ptarmiganlabs.net │ 9d5d7900-3e52-4f22-b6b9-51f38a3afe86 │ 24                     │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ dev1    │ pro2-win2.lab.ptarmiganlabs.net │ d0510bbe-c686-459b-b10e-713fcf3951e8 │ 6                      │
└─────────┴─────────────────────────────────┴──────────────────────────────────────┴────────────────────────┘

2024-11-19T06:52:25.932Z warn: Virtual proxy is not linked to any proxy. Prefix="mobile", Session cookie header name="X-Qlik-Session-mob"
2024-11-19T06:52:26.494Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr", Session cookie header name="X-Qlik-Session-hdr-dev"
2024-11-19T06:52:28.822Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr-access1", Session cookie header name="X-Qlik-Session-hdr-access1"
2024-11-19T06:52:31.057Z info:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ -- Sessions per virtual proxy and proxy services --                                                                                                                                                                                                                                            │
│                                                                                                                                                                                                                                                                                                │
│ Total number of sessions: 4                                                                                                                                                                                                                                                                    │
│                                                                                                                                                                                                                                                                                                │
│ Sessions per proxy service:                                                                                                                                                                                                                                                                    │
│    Central: pro2-win1.lab.ptarmiganlabs.net: 4                                                                                                                                                                                                                                                 │
│    dev1: pro2-win2.lab.ptarmiganlabs.net: 0                                                                                                                                                                                                                                                    │
│                                                                                                                                                                                                                                                                                                │
├───────────────────────────┬──────────────────────┬─────────────────────────────────────┬─────────────────────────────────┬──────────────────────────────────────────┬────────────────────────┬─────────────────┬───────────────────┬────────────────────┬──────────────────────────────────────┤
│ Virtual proxy description │ Virtual proxy prefix │ Virtual proxy session cookie header │ Linked proxy service            │ Load balancing nodes                     │ Session user directory │ Session user ID │ Session user name │ Session attributes │ Session ID                           │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Central Proxy (Default)   │                      │ X-Qlik-Session                      │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ goran           │                   │                    │ ea7821ab-dbad-4b1f-851d-cb06a73e10a7 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_1      │                   │                    │ 2734806e-c2e6-4d72-8c84-8a1964638fc3 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_2      │                   │                    │ 39950c34-b0bc-4e12-a2f8-b9e29a0f143f │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_3      │                   │                    │ d57f7cd5-caa7-4bf9-977f-ccdde97e222f │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
└───────────────────────────┴──────────────────────┴─────────────────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────┴────────────────────────┴─────────────────┴───────────────────┴────────────────────┴──────────────────────────────────────┘

Add some sessions

To explore the various options for the session-get command, let’s first add some sessions to the Sense environment.

This can be done in different ways:

  • Manually by logging in as different users in incognito/private browser windows.
  • Using the Qlik Scalability Tools.
  • By scripting the creation of sessions using browser automation tools, example in this blog post.
  • By scripting the creation of sessions using PowerShell.

In this example we’ll use the last option above, and create some new Analyzer sessions.

Let’s see what the session-get command returns now

 .\ctrl-q.exe qseow session-get `
   --auth-type cert `
   --host pro2-win1.lab.ptarmiganlabs.net `
   --auth-user-dir LAB `
   --auth-user-id goran `
   --output-format table

The output now shows new sessions for users testuser_21, testuser_22, testuser_23 and testuser_24.

2024-11-19T06:58:28.721Z info: -----------------------------------------------------------
2024-11-19T06:58:28.721Z info: | Ctrl-Q
2024-11-19T06:58:28.721Z info: |
2024-11-19T06:58:28.721Z info: | Version      : 4.1.0
2024-11-19T06:58:28.721Z info: | Log level    : info
2024-11-19T06:58:28.721Z info: |
2024-11-19T06:58:28.721Z info: | Command      : session-get
2024-11-19T06:58:28.721Z info: |              : get info about proxy sessions on one or more virtual proxies
2024-11-19T06:58:28.721Z info: |
2024-11-19T06:58:28.721Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T06:58:28.721Z info: |
2024-11-19T06:58:28.721Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T06:58:28.721Z info: ----------------------------------------------------------
2024-11-19T06:58:28.721Z info:
2024-11-19T06:58:28.736Z info: Get Qlik Sense proxy sessions
2024-11-19T06:58:29.267Z info: Successfully retrieved 29 virtual proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T06:58:29.581Z info: Successfully retrieved 2 proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T06:58:29.596Z info: Available Proxy services.
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Available proxy services.                                                                                 │
│                                                                                                           │
│ Note: The "sessions-get" command will only work correctly if the correct --host parameter is used when ca │
│ lling Ctrl-Q.                                                                                             │
│ The --host parameter should be one of the host names listed below.                                        │
├─────────┬─────────────────────────────────┬──────────────────────────────────────┬────────────────────────┤
│ Name    │ Host name                       │ Id                                   │ Linked virtual proxies │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ Central │ pro2-win1.lab.ptarmiganlabs.net │ 9d5d7900-3e52-4f22-b6b9-51f38a3afe86 │ 24                     │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ dev1    │ pro2-win2.lab.ptarmiganlabs.net │ d0510bbe-c686-459b-b10e-713fcf3951e8 │ 6                      │
└─────────┴─────────────────────────────────┴──────────────────────────────────────┴────────────────────────┘

2024-11-19T06:58:29.736Z warn: Virtual proxy is not linked to any proxy. Prefix="mobile", Session cookie header name="X-Qlik-Session-mob"
2024-11-19T06:58:30.285Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr", Session cookie header name="X-Qlik-Session-hdr-dev"
2024-11-19T06:58:31.783Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr-access1", Session cookie header name="X-Qlik-Session-hdr-access1"
2024-11-19T06:58:34.050Z info:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ -- Sessions per virtual proxy and proxy services --                                                                                                                                                                                                                                            │
│                                                                                                                                                                                                                                                                                                │
│ Total number of sessions: 8                                                                                                                                                                                                                                                                    │
│                                                                                                                                                                                                                                                                                                │
│ Sessions per proxy service:                                                                                                                                                                                                                                                                    │
│    Central: pro2-win1.lab.ptarmiganlabs.net: 8                                                                                                                                                                                                                                                 │
│    dev1: pro2-win2.lab.ptarmiganlabs.net: 0                                                                                                                                                                                                                                                    │
│                                                                                                                                                                                                                                                                                                │
├───────────────────────────┬──────────────────────┬─────────────────────────────────────┬─────────────────────────────────┬──────────────────────────────────────────┬────────────────────────┬─────────────────┬───────────────────┬────────────────────┬──────────────────────────────────────┤
│ Virtual proxy description │ Virtual proxy prefix │ Virtual proxy session cookie header │ Linked proxy service            │ Load balancing nodes                     │ Session user directory │ Session user ID │ Session user name │ Session attributes │ Session ID                           │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Central Proxy (Default)   │                      │ X-Qlik-Session                      │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ goran           │                   │                    │ ea7821ab-dbad-4b1f-851d-cb06a73e10a7 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_1      │                   │                    │ 2734806e-c2e6-4d72-8c84-8a1964638fc3 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_2      │                   │                    │ 39950c34-b0bc-4e12-a2f8-b9e29a0f143f │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_3      │                   │                    │ d57f7cd5-caa7-4bf9-977f-ccdde97e222f │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_21     │                   │                    │ 98f79431-fcca-414c-8589-484beea90500 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_22     │                   │                    │ a0307030-0701-43f2-86c6-759a11e32b8b │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_23     │                   │                    │ 0748b9cb-2538-43d0-aa20-adb10ac63b07 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_24     │                   │                    │ 8d7d5170-c9d5-4601-b528-16c56ddd2ff1 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
└───────────────────────────┴──────────────────────┴─────────────────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────┴────────────────────────┴─────────────────┴───────────────────┴────────────────────┴──────────────────────────────────────┘

It is also possible to filter the output to only show sessions for a specific virtual proxy or proxy service.
This is done using the --session-virtual-proxy and -proxy-host options.
Each of them takes one or more values.

Usage: ctrl-q qseow session-get [options]

get info about proxy sessions on one or more virtual proxies

Options:
  --log-level <level>                  log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                        Qlik Sense host (IP/FQDN) where Qlik Repository Service (QRS) is running
  --qrs-port <port>                    Qlik Sense repository service (QRS) port (usually 4242) (default: "4242")
  --virtual-proxy <prefix>             Qlik Sense virtual proxy prefix to access QRS via (default: "")
  --secure <true|false>                https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --session-virtual-proxy <prefix...>  one or more Qlik Sense virtual proxies to get sessions for
  --host-proxy <host...>               Qlik Sense hosts/proxies (IP/FQDN) to get sessions from. Must match the host names of the Sense nodes
  --qps-port <port>                    Qlik Sense proxy service (QPS) port (usually 4243) (default: "4243")
  --auth-user-dir <directory>          user directory for user to connect with
  --auth-user-id <userid>              user ID for user to connect with
  -a, --auth-type <type>               authentication type (choices: "cert", default: "cert")
  --auth-cert-file <file>              Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>          Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>         Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --output-format <json|table>         output format (default: "json")
  -s, --sort-by <column>               column to sort output table by (choices: "prefix", "proxyhost", "proxyname", "userdir", "userid", "username", default: "prefix")
  -h, --help                           display help for command

Let’s filter to only show the sessions connected to the hdr virtual proxy:

.\ctrl-q.exe qseow session-get `
   --auth-type cert `
   --host pro2-win1.lab.ptarmiganlabs.net `
   --auth-user-dir LAB `
   --auth-user-id goran `
   --output-format table `
   --session-virtual-proxy hdr
2024-11-19T07:01:09.130Z info: -----------------------------------------------------------
2024-11-19T07:01:09.145Z info: | Ctrl-Q
2024-11-19T07:01:09.145Z info: |
2024-11-19T07:01:09.145Z info: | Version      : 4.1.0
2024-11-19T07:01:09.145Z info: | Log level    : info
2024-11-19T07:01:09.145Z info: |
2024-11-19T07:01:09.145Z info: | Command      : session-get
2024-11-19T07:01:09.145Z info: |              : get info about proxy sessions on one or more virtual proxies
2024-11-19T07:01:09.145Z info: |
2024-11-19T07:01:09.145Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T07:01:09.145Z info: |
2024-11-19T07:01:09.145Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T07:01:09.145Z info: ----------------------------------------------------------
2024-11-19T07:01:09.145Z info:
2024-11-19T07:01:09.145Z info: Get Qlik Sense proxy sessions
2024-11-19T07:01:09.521Z info: Successfully retrieved 2 virtual proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:01:09.911Z info: Successfully retrieved 2 proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:01:09.926Z info: Available Proxy services.
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Available proxy services.                                                                                 │
│                                                                                                           │
│ Note: The "sessions-get" command will only work correctly if the correct --host parameter is used when ca │
│ lling Ctrl-Q.                                                                                             │
│ The --host parameter should be one of the host names listed below.                                        │
├─────────┬─────────────────────────────────┬──────────────────────────────────────┬────────────────────────┤
│ Name    │ Host name                       │ Id                                   │ Linked virtual proxies │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ Central │ pro2-win1.lab.ptarmiganlabs.net │ 9d5d7900-3e52-4f22-b6b9-51f38a3afe86 │ 24                     │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ dev1    │ pro2-win2.lab.ptarmiganlabs.net │ d0510bbe-c686-459b-b10e-713fcf3951e8 │ 6                      │
└─────────┴─────────────────────────────────┴──────────────────────────────────────┴────────────────────────┘

2024-11-19T07:01:09.926Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr", Session cookie header name="X-Qlik-Session-hdr-dev"
2024-11-19T07:01:10.099Z info:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ -- Sessions per virtual proxy and proxy services --                                                                                                                                                                                                                                            │
│                                                                                                                                                                                                                                                                                                │
│ Total number of sessions: 7                                                                                                                                                                                                                                                                    │
│                                                                                                                                                                                                                                                                                                │
│ Sessions per proxy service:                                                                                                                                                                                                                                                                    │
│    Central: pro2-win1.lab.ptarmiganlabs.net: 7                                                                                                                                                                                                                                                 │
│                                                                                                                                                                                                                                                                                                │
├───────────────────────────┬──────────────────────┬─────────────────────────────────────┬─────────────────────────────────┬──────────────────────────────────────────┬────────────────────────┬─────────────────┬───────────────────┬────────────────────┬──────────────────────────────────────┤
│ Virtual proxy description │ Virtual proxy prefix │ Virtual proxy session cookie header │ Linked proxy service            │ Load balancing nodes                     │ Session user directory │ Session user ID │ Session user name │ Session attributes │ Session ID                           │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_1      │                   │                    │ 2734806e-c2e6-4d72-8c84-8a1964638fc3 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_2      │                   │                    │ 39950c34-b0bc-4e12-a2f8-b9e29a0f143f │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_3      │                   │                    │ d57f7cd5-caa7-4bf9-977f-ccdde97e222f │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_21     │                   │                    │ 98f79431-fcca-414c-8589-484beea90500 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_22     │                   │                    │ a0307030-0701-43f2-86c6-759a11e32b8b │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_23     │                   │                    │ 0748b9cb-2538-43d0-aa20-adb10ac63b07 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Header proxy at CENTRAL   │ hdr                  │ X-Qlik-Session-hdr-central          │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ testuser_24     │                   │                    │ 8d7d5170-c9d5-4601-b528-16c56ddd2ff1 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
└───────────────────────────┴──────────────────────┴─────────────────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────┴────────────────────────┴─────────────────┴───────────────────┴────────────────────┴──────────────────────────────────────┘

Similarly, it is possible to filter to only show sessions for a specific proxy service by specifying one or more proxy hosts in the --host-proxy option.

Delete proxy sessions

Deleting proxy sessions it is only possible for one virtual proxy and proxy service at a time.

If one or more session IDs are provided to Ctrl-Q, those sessions will be deleted.
If no session IDs are provided, all sessions for the specified virtual proxy and proxy service will be deleted.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow session-delete --help
Usage: ctrl-q qseow session-delete [options]

delete proxy session(s) on a specific virtual proxy and proxy service

Options:
  --log-level <level>               log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                     Qlik Sense host (IP/FQDN) where Qlik Repository Service (QRS) is running
  --qrs-port <port>                 Qlik Sense repository service (QRS) port (usually 4242) (default: "4242")
  --virtual-proxy <prefix>          Qlik Sense virtual proxy prefix to access QRS via (default: "")
  --secure <true|false>             https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --session-id <id...>              session IDs to delete
  --session-virtual-proxy <prefix>  Qlik Sense virtual proxy (prefix) to delete proxy session(s) on (default: "")
  --host-proxy <host>               Qlik Sense proxy (IP/FQDN) where sessions should be deleted. Must match the host name of a Sense node
  --qps-port <port>                 Qlik Sense proxy service (QPS) port (usually 4243) (default: "4243")
  --auth-user-dir <directory>       user directory for user to connect with
  --auth-user-id <userid>           user ID for user to connect with
  -a, --auth-type <type>            authentication type (choices: "cert", default: "cert")
  --auth-cert-file <file>           Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>       Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>      Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  -h, --help                        display help for command

Example: Delete specific sessions

Let’s delete two specific sessions for users testuser_1 and testuser_2, using the session IDs from the previous example, for the win virtual proxy on the pro2-win1.lab.ptarmiganlabs.net host.

.\ctrl-q.exe qseow session-delete `
   --auth-type cert `
   --host pro2-win1.lab.ptarmiganlabs.net `
   --auth-user-dir LAB `
   --auth-user-id goran `
   --host-proxy pro2-win1.lab.ptarmiganlabs.net `
   --session-virtual-proxy "hdr" `
   --session-id 2734806e-c2e6-4d72-8c84-8a1964638fc3 39950c34-b0bc-4e12-a2f8-b9e29a0f143f

The output shows that the sessions were deleted:

2024-11-19T07:03:31.754Z info: -----------------------------------------------------------
2024-11-19T07:03:31.769Z info: | Ctrl-Q
2024-11-19T07:03:31.769Z info: |
2024-11-19T07:03:31.769Z info: | Version      : 4.1.0
2024-11-19T07:03:31.769Z info: | Log level    : info
2024-11-19T07:03:31.769Z info: |
2024-11-19T07:03:31.769Z info: | Command      : session-delete
2024-11-19T07:03:31.769Z info: |              : delete proxy session(s) on a specific virtual proxy and proxy service
2024-11-19T07:03:31.769Z info: |
2024-11-19T07:03:31.769Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T07:03:31.769Z info: |
2024-11-19T07:03:31.769Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T07:03:31.769Z info: ----------------------------------------------------------
2024-11-19T07:03:31.769Z info:
2024-11-19T07:03:31.769Z info: Delete Qlik Sense proxy sessions
2024-11-19T07:03:31.769Z info: Deleting sessions on proxy "pro2-win1.lab.ptarmiganlabs.net", virtual proxy "hdr"
2024-11-19T07:03:32.160Z info: Successfully retrieved 2 virtual proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:03:32.520Z info: Successfully retrieved 2 proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:03:32.535Z info: Available Proxy services.
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Available proxy services.                                                                                 │
│                                                                                                           │
│ Note: The "sessions-get" command will only work correctly if the correct --host parameter is used when ca │
│ lling Ctrl-Q.                                                                                             │
│ The --host parameter should be one of the host names listed below.                                        │
├─────────┬─────────────────────────────────┬──────────────────────────────────────┬────────────────────────┤
│ Name    │ Host name                       │ Id                                   │ Linked virtual proxies │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ Central │ pro2-win1.lab.ptarmiganlabs.net │ 9d5d7900-3e52-4f22-b6b9-51f38a3afe86 │ 24                     │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ dev1    │ pro2-win2.lab.ptarmiganlabs.net │ d0510bbe-c686-459b-b10e-713fcf3951e8 │ 6                      │
└─────────┴─────────────────────────────────┴──────────────────────────────────────┴────────────────────────┘

2024-11-19T07:03:32.535Z info: ✅ All host names specified in the --host-proxy parameter are valid.
2024-11-19T07:03:32.817Z info: Session ID "2734806e-c2e6-4d72-8c84-8a1964638fc3" successfully deleted. User: LAB\testuser_1
2024-11-19T07:03:32.957Z info: Session ID "39950c34-b0bc-4e12-a2f8-b9e29a0f143f" successfully deleted. User: LAB\testuser_2
2024-11-19T07:03:32.957Z info:
2024-11-19T07:03:32.957Z info: Deleted 2 sessions

Example: Delete all sessions connected to a virtual proxy

To delete all sessions connected to a specific virtual proxy via its linked proxy service, simply omit the --session-id option.
This will prompt for confirmation before deleting the sessions.

Let’s delete all sessions connected to the finance virtual proxy on the pro2-win1.lab.ptarmiganlabs.net host:

.\ctrl-q.exe qseow session-delete `
   --auth-type cert `
   --host pro2-win1.lab.ptarmiganlabs.net `
   --auth-user-dir LAB `
   --auth-user-id goran `
   --host-proxy pro2-win1.lab.ptarmiganlabs.net `
   --session-virtual-proxy "hdr"

The output shows that the sessions were deleted:

2024-11-19T07:05:10.347Z info: -----------------------------------------------------------
2024-11-19T07:05:10.347Z info: | Ctrl-Q
2024-11-19T07:05:10.347Z info: |
2024-11-19T07:05:10.347Z info: | Version      : 4.1.0
2024-11-19T07:05:10.347Z info: | Log level    : info
2024-11-19T07:05:10.347Z info: |
2024-11-19T07:05:10.347Z info: | Command      : session-delete
2024-11-19T07:05:10.347Z info: |              : delete proxy session(s) on a specific virtual proxy and proxy service
2024-11-19T07:05:10.347Z info: |
2024-11-19T07:05:10.347Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T07:05:10.347Z info: |
2024-11-19T07:05:10.347Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T07:05:10.347Z info: ----------------------------------------------------------
2024-11-19T07:05:10.347Z info:
2024-11-19T07:05:10.347Z info: Delete Qlik Sense proxy sessions
2024-11-19T07:05:10.347Z info: Deleting sessions on proxy "pro2-win1.lab.ptarmiganlabs.net", virtual proxy "hdr"
2024-11-19T07:05:10.769Z info: Successfully retrieved 2 virtual proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:05:11.112Z info: Successfully retrieved 2 proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:05:11.128Z info: Available Proxy services.
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Available proxy services.                                                                                 │
│                                                                                                           │
│ Note: The "sessions-get" command will only work correctly if the correct --host parameter is used when ca │
│ lling Ctrl-Q.                                                                                             │
│ The --host parameter should be one of the host names listed below.                                        │
├─────────┬─────────────────────────────────┬──────────────────────────────────────┬────────────────────────┤
│ Name    │ Host name                       │ Id                                   │ Linked virtual proxies │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ Central │ pro2-win1.lab.ptarmiganlabs.net │ 9d5d7900-3e52-4f22-b6b9-51f38a3afe86 │ 24                     │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ dev1    │ pro2-win2.lab.ptarmiganlabs.net │ d0510bbe-c686-459b-b10e-713fcf3951e8 │ 6                      │
└─────────┴─────────────────────────────────┴──────────────────────────────────────┴────────────────────────┘

2024-11-19T07:05:11.128Z info: ✅ All host names specified in the --host-proxy parameter are valid.
2024-11-19T07:05:11.128Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr", Session cookie header name="X-Qlik-Session-hdr-dev"
2024-11-19T07:05:11.284Z info:
                                  No session IDs specified, meaning that all existing sessions will be deleted for proxy "pro2-win1.lab.ptarmiganlabs.net" and virtual proxy "hdr".

                                  Are you sure you want to continue? (y/n) y
2024-11-19T07:05:14.269Z info:
2024-11-19T07:05:14.269Z info: Deleting sessions...
2024-11-19T07:05:14.425Z info: Session ID "d57f7cd5-caa7-4bf9-977f-ccdde97e222f" successfully deleted. User: LAB\testuser_3
2024-11-19T07:05:14.581Z info: Session ID "98f79431-fcca-414c-8589-484beea90500" successfully deleted. User: LAB\testuser_21
2024-11-19T07:05:14.753Z info: Session ID "a0307030-0701-43f2-86c6-759a11e32b8b" successfully deleted. User: LAB\testuser_22
2024-11-19T07:05:14.909Z info: Session ID "0748b9cb-2538-43d0-aa20-adb10ac63b07" successfully deleted. User: LAB\testuser_23
2024-11-19T07:05:15.066Z info: Session ID "8d7d5170-c9d5-4601-b528-16c56ddd2ff1" successfully deleted. User: LAB\testuser_24
2024-11-19T07:05:15.066Z info:
2024-11-19T07:05:15.066Z info: Deleted 5 sessions

At this point there is only one session left, the one for the LAB\goran user.

2024-11-19T07:05:50.747Z info: -----------------------------------------------------------
2024-11-19T07:05:50.747Z info: | Ctrl-Q
2024-11-19T07:05:50.747Z info: |
2024-11-19T07:05:50.747Z info: | Version      : 4.1.0
2024-11-19T07:05:50.747Z info: | Log level    : info
2024-11-19T07:05:50.747Z info: |
2024-11-19T07:05:50.747Z info: | Command      : session-get
2024-11-19T07:05:50.747Z info: |              : get info about proxy sessions on one or more virtual proxies
2024-11-19T07:05:50.747Z info: |
2024-11-19T07:05:50.747Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T07:05:50.747Z info: |
2024-11-19T07:05:50.747Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T07:05:50.747Z info: ----------------------------------------------------------
2024-11-19T07:05:50.747Z info:
2024-11-19T07:05:50.762Z info: Get Qlik Sense proxy sessions
2024-11-19T07:05:51.325Z info: Successfully retrieved 29 virtual proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:05:51.653Z info: Successfully retrieved 2 proxies from host pro2-win1.lab.ptarmiganlabs.net
2024-11-19T07:05:51.668Z info: Available Proxy services.
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Available proxy services.                                                                                 │
│                                                                                                           │
│ Note: The "sessions-get" command will only work correctly if the correct --host parameter is used when ca │
│ lling Ctrl-Q.                                                                                             │
│ The --host parameter should be one of the host names listed below.                                        │
├─────────┬─────────────────────────────────┬──────────────────────────────────────┬────────────────────────┤
│ Name    │ Host name                       │ Id                                   │ Linked virtual proxies │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ Central │ pro2-win1.lab.ptarmiganlabs.net │ 9d5d7900-3e52-4f22-b6b9-51f38a3afe86 │ 24                     │
├─────────┼─────────────────────────────────┼──────────────────────────────────────┼────────────────────────┤
│ dev1    │ pro2-win2.lab.ptarmiganlabs.net │ d0510bbe-c686-459b-b10e-713fcf3951e8 │ 6                      │
└─────────┴─────────────────────────────────┴──────────────────────────────────────┴────────────────────────┘

2024-11-19T07:05:51.825Z warn: Virtual proxy is not linked to any proxy. Prefix="mobile", Session cookie header name="X-Qlik-Session-mob"
2024-11-19T07:05:52.434Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr", Session cookie header name="X-Qlik-Session-hdr-dev"
2024-11-19T07:05:53.966Z warn: Virtual proxy is not linked to any proxy. Prefix="hdr-access1", Session cookie header name="X-Qlik-Session-hdr-access1"
2024-11-19T07:05:56.168Z info:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ -- Sessions per virtual proxy and proxy services --                                                                                                                                                                                                                                            │
│                                                                                                                                                                                                                                                                                                │
│ Total number of sessions: 1                                                                                                                                                                                                                                                                    │
│                                                                                                                                                                                                                                                                                                │
│ Sessions per proxy service:                                                                                                                                                                                                                                                                    │
│    Central: pro2-win1.lab.ptarmiganlabs.net: 1                                                                                                                                                                                                                                                 │
│    dev1: pro2-win2.lab.ptarmiganlabs.net: 0                                                                                                                                                                                                                                                    │
│                                                                                                                                                                                                                                                                                                │
├───────────────────────────┬──────────────────────┬─────────────────────────────────────┬─────────────────────────────────┬──────────────────────────────────────────┬────────────────────────┬─────────────────┬───────────────────┬────────────────────┬──────────────────────────────────────┤
│ Virtual proxy description │ Virtual proxy prefix │ Virtual proxy session cookie header │ Linked proxy service            │ Load balancing nodes                     │ Session user directory │ Session user ID │ Session user name │ Session attributes │ Session ID                           │
├───────────────────────────┼──────────────────────┼─────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────┼────────────────────────┼─────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────┤
│ Central Proxy (Default)   │                      │ X-Qlik-Session                      │ Central:                        │ Central: pro2-win1.lab.ptarmiganlabs.net │ LAB                    │ goran           │                   │                    │ ea7821ab-dbad-4b1f-851d-cb06a73e10a7 │
│                           │                      │                                     │ pro2-win1.lab.ptarmiganlabs.net │                                          │                        │                 │                   │                    │                                      │
└───────────────────────────┴──────────────────────┴─────────────────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────┴────────────────────────┴─────────────────┴───────────────────┴────────────────────┴──────────────────────────────────────┘

1.9 - Tasks

Reload, external program and user sync tasks.

Page contents:


List tasks as tree

This command provides a hierarchical tree view of reload tasks and external program tasks, similar to what is available in QlikView.

The tree view can be enhanced with colors (see this page) and task details.

There are quite a few customisation options available when creating a task tree.
Note that some options are used when creating task tables, these are not applicable for task trees. Ctrl-Q will show an error when invalid combinations of options are used.

Here Windows Terminal is used to run Ctrl-Q.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow task-get --help
Usage: ctrl-q qseow task-get [options]

get info about one or more tasks

Options:
  --log-level <level>            log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                  Qlik Sense server IP/FQDN
  --port <port>                  Qlik Sense repository service (QRS) port (usually 4242 for cert auth, 443 for jwt auth) (default: "4242")
  --schema-version <string>      Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>       Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>          https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>    user directory for user to connect with
  --auth-user-id <userid>        user ID for user to connect with
  -a, --auth-type <type>         authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>        Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>    Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>   Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>               JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --task-type <type...>          type of tasks to include (choices: "reload", "ext-program")
  --task-id <ids...>             use task IDs to select which tasks to retrieve. Only allowed when --output-format=table
  --task-tag <tags...>           use tags to select which tasks to retrieve. Only allowed when --output-format=table
  --output-format <format>       output format (choices: "table", "tree", default: "tree")
  --output-dest <dest>           where to send task info (choices: "screen", "file", default: "screen")
  --output-file-name <name>      file name to store task info in (default: "")
  --output-file-format <format>  file type/format (choices: "excel", "csv", "json", default: "excel")
  --output-file-overwrite        overwrite output file without asking
  --text-color <show>            use colored text in task views (choices: "yes", "no", default: "yes")
  --tree-icons                   display task status icons in tree view
  --tree-details [detail...]     display details for each task in tree view (choices: "taskid", "laststart", "laststop", "nextstart", "appname", "appstream", default: "")
  --table-details [detail...]    which aspects of tasks should be included in table view. Not choosing any details will show all (choices: "common", "lastexecution", "tag", "customproperty", "schematrigger",
                                 "compositetrigger", default: "")
  -h, --help                     display help for command

Note:
Task trees are currently an all-or-nothing feature.
It is not possible to use the --task-id or --task-tag options when showing task trees.

Tree icons

If --tree-icons is used when starting Ctrl-Q emojis will be used to indicate the last known state for each task.

The used emojis are

Descriptions
Shown at the top of the tree of scheduled tasks. All tasks below this node have a time-based scheduled.
Finished successfully.
Failed
🚫 Skipped
🛑 Aborted
💤 Never started
Unknown

Text color

If --text-color yes is specified (yes is also the default value) colors will be used to make the created tree more readable.
--text-color no will create a plain-text tree (no colors).

Example: Task tree details

The --tree-details option makes it possible to switch on/off individual task details. This can be useful to make the task tree easier to read.
The allowed values for this option are taskid, laststart, laststop, nextstart, appname, appstream.

Let’s say we want a task tree with the app name and next start time for the task:

.\ctrl-q.exe qseow task-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format tree `
  --output-dest screen `
  --tree-icons `
  --text-color yes `
  --tree-details nextstart appname

Note how Ctrl-Q detects and warns about cyclic task dependencies:

Qlik Sense task tree 5

Example: Save tree to disk file

Under the hood the task tree is stored as a JSON structure.
It’s possible to save this JSON to disk:

.\ctrl-q.exe qseow task-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format tree `
  --output-dest file `
  --tree-details appname `
  --output-file-name tasktree.json `
  --output-file-format json
2024-11-15T15:51:37.179Z info: -----------------------------------------------------------
2024-11-15T15:51:37.182Z info: | Ctrl-Q
2024-11-15T15:51:37.182Z info: |
2024-11-15T15:51:37.182Z info: | Version      : 4.0.0
2024-11-15T15:51:37.183Z info: | Log level    : info
2024-11-15T15:51:37.183Z info: |
2024-11-15T15:51:37.183Z info: | Command      : task-get
2024-11-15T15:51:37.183Z info: |              : get info about one or more tasks
2024-11-15T15:51:37.185Z info: |
2024-11-15T15:51:37.185Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:51:37.185Z info: |
2024-11-15T15:51:37.185Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:51:37.186Z info: ----------------------------------------------------------
2024-11-15T15:51:37.186Z info:
2024-11-15T15:51:37.546Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T15:51:39.840Z warn: Cyclic dependency detected in task tree, from task "[ctrl-q task chain 11.1] Reload task of Ctrl-Q reload chain app 1-1" to "[ctrl-q task chain 2] Reload task of Ctrl-Q reload chain app 2-1". Won't go deeper.
2024-11-15T15:51:39.841Z warn: Cyclic dependency detected in task tree, from task "[ctrl-q task chain 10.1] Reload task of Ctrl-Q reload chain app 1-1" to "[ctrl-q task chain 11.1] Reload task of Ctrl-Q reload chain app 1-1". Won't go deeper.
2024-11-15T15:51:39.843Z info: ✅ Writing task tree to disk file "tasktree.json".

Running the same command again, when the destination file already exists, results in a question to overwrite the file:

2024-11-15T15:52:07.252Z info: -----------------------------------------------------------
2024-11-15T15:52:07.254Z info: | Ctrl-Q
2024-11-15T15:52:07.256Z info: |
2024-11-15T15:52:07.256Z info: | Version      : 4.0.0
2024-11-15T15:52:07.256Z info: | Log level    : info
2024-11-15T15:52:07.257Z info: |
2024-11-15T15:52:07.257Z info: | Command      : task-get
2024-11-15T15:52:07.257Z info: |              : get info about one or more tasks
2024-11-15T15:52:07.257Z info: |
2024-11-15T15:52:07.257Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:52:07.258Z info: |
2024-11-15T15:52:07.258Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:52:07.258Z info: ----------------------------------------------------------
2024-11-15T15:52:07.258Z info:
2024-11-15T15:52:07.612Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T15:52:09.800Z warn: Cyclic dependency detected in task tree, from task "[ctrl-q task chain 11.1] Reload task of Ctrl-Q reload chain app 1-1" to "[ctrl-q task chain 2] Reload task of Ctrl-Q reload chain app 2-1". Won't go deeper.
2024-11-15T15:52:09.800Z warn: Cyclic dependency detected in task tree, from task "[ctrl-q task chain 10.1] Reload task of Ctrl-Q reload chain app 1-1" to "[ctrl-q task chain 11.1] Reload task of Ctrl-Q reload chain app 1-1". Won't go deeper.
2024-11-15T15:52:09.802Z info:
                                  Destination file "tasktree.json" exists. Do you want to overwrite it? (y/n) y
2024-11-15T15:52:10.432Z info:
2024-11-15T15:52:10.432Z info: ✅ Writing task tree to disk file "tasktree.json".

To forcibly overwrite the destination file the --output-file-overwrite option can be specified.

List tasks as table

This command provides a tabular view of tasks.
Tags, custom properties, schedules, triggers and references to other tasks are all included in the table. This tabular task view can be shown on screen or saved to disk as Excel or CSV files.

The idea is that all information needed to recreate the tasks should be included in the table.
In reality a few more fields are included, for example app name for the app associated with a task.

The table view can be enhanced with colours (see this page) and task details.

There are quite a few customisation options available when creating a task tree.
Note that some options are used when creating task tables, these are not applicable for task trees. Ctrl-Q will show an error when invalid combinations of options are used.

Example: Show task table on screen

Show a list of tasks on screen, including main task fields as well as any tags defined for the tasks.

.\ctrl-q.exe qseow task-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format table `
  --output-dest screen `
  --task-type reload ext-program `
  --table-details common tag

Note:
It’s possible to get more information about tasks by adding additional values to the --table-details option.
Run .\ctrl-q.exe task-get --help to show a complete list of all options and their allowed values.

If --table-details is not specified all available information will be showed about the tasks.
This will result in a very wide table!

2024-11-15T15:54:40.045Z info: -----------------------------------------------------------
2024-11-15T15:54:40.049Z info: | Ctrl-Q
2024-11-15T15:54:40.049Z info: |
2024-11-15T15:54:40.049Z info: | Version      : 4.0.0
2024-11-15T15:54:40.050Z info: | Log level    : info
2024-11-15T15:54:40.050Z info: |
2024-11-15T15:54:40.050Z info: | Command      : task-get
2024-11-15T15:54:40.050Z info: |              : get info about one or more tasks
2024-11-15T15:54:40.050Z info: |
2024-11-15T15:54:40.050Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:54:40.050Z info: |
2024-11-15T15:54:40.050Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:54:40.050Z info: ----------------------------------------------------------
2024-11-15T15:54:40.051Z info:
2024-11-15T15:54:40.416Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T15:54:42.709Z info: # rows in table: 102
2024-11-15T15:54:42.711Z info: # reload tasks in table: 86
2024-11-15T15:54:42.711Z info: # external program tasks in table: 16
2024-11-15T15:54:42.793Z info:
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ # reload tasks: 68, # external program tasks: 8, # rows in table: 76

├──────────────┬──────────────────┬──────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────┬──────────────┬──────────────┬──────────────┬──────────────────────────────────────┬────────────────┬────────────────────┬───────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────┤
│ Task counter │ Task type        │ Task name                                                                │ Task id                              │ Task enabled │ Task timeout │ Task retries │ App id                               │ Partial reload │ Manually triggered │ Ext program path                                          │ Ext program parameters
              │ Tags                                                     │
├──────────────┼──────────────────┼──────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│ 1            │ External program │ App snapshots end of September 2022                                      │ c5cc047d-e520-4ccb-b88f-ac4f9d49d4be │ true         │ 60           │ 1            │                                      │                │                    │ powershell.exe                                            │ -File \\pro2-win1\c$\tools\script\qs_archive_apps_to_stream_end_of_sept.ps1 │                                                          │
├──────────────┼──────────────────┼──────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│ 2            │ External program │ Ext program task chaining 1                                              │ 4ce41cf3-bc6a-4f66-ad00-ffdeb9a7e468 │ true         │ 15           │ 0            │                                      │                │                    │ powershell.exe                                            │ -File \\pro2-win1\c$\tools\script\ext_task_1.ps1
              │                                                          │
├──────────────┼──────────────────┼──────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│ 3            │ External program │ Node-RED ext program task demo 1                                         │ d6bfc66a-393b-4eea-8ecd-1b1629c91683 │ true         │ 30           │ 0            │                                      │                │                    │ powershell.exe                                            │
              │ Ctrl-Q demo                                              │
├──────────────┼──────────────────┼──────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│ 4            │ External program │ PowerShell export data connections                                       │ e7b8d484-5297-4caf-a727-38200905171e │ true         │ 15           │ 1            │                                      │                │                    │ powershell                                                │ -File \\pro2-win1\c$\tools\script\qs_export_data_connections.ps1            │                                                          │
├──────────────┼──────────────────┼──────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│ 5            │ External program │ PowerShell export tags (ext pgm task)                                    │ 1d5dc4c1-8bd3-455a-9e6a-873da103a950 │ true         │ 15           │ 0            │                                      │                │                    │ powershell                                                │ -File \\pro2-win1\c$\tools\script\qs_export_tags_cps.ps1                    │                                                          │
├──────────────┼──────────────────┼──────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│ 6            │ External program │ Sample external task                                                     │ 7d4617cd-a9d5-433a-8c82-742e58bfb38b │ true         │ 1440         │ 0            │                                      │                │                    │ C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe │ -File \\pro2-win1\c$\tools\script\ext_task_1.ps1
              │                                                          │
├──────────────┼──────────────────┼──────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
...
...

The --task-id and --task-tag options take a list of task IDs and tags, respectively.
When used only the tasks matching the specified task IDs and tags will be included in the created table.
These options can be used both when showing the task table on screen and when storing it on disk.

Example command using these options. Note the double quotes around the task tags:

.\ctrl-q.exe qseow task-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format table `
  --output-dest screen `
  --table-details common tag `
  --task-id e3b27f50-b1c0-4879-88fc-c7cdd9c1cf3e 09b3c78f-04dd-45e3-a4bf-1b074d6572fa `
  --task-tag "Demo apps" "Finance" "Sales forecast"
2024-11-15T15:57:58.389Z info: -----------------------------------------------------------
2024-11-15T15:57:58.393Z info: | Ctrl-Q
2024-11-15T15:57:58.393Z info: |
2024-11-15T15:57:58.394Z info: | Version      : 4.0.0
2024-11-15T15:57:58.394Z info: | Log level    : info
2024-11-15T15:57:58.394Z info: |
2024-11-15T15:57:58.395Z info: | Command      : task-get
2024-11-15T15:57:58.395Z info: |              : get info about one or more tasks
2024-11-15T15:57:58.396Z info: |
2024-11-15T15:57:58.397Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:57:58.397Z info: |
2024-11-15T15:57:58.397Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:57:58.397Z info: ----------------------------------------------------------
2024-11-15T15:57:58.398Z info:
2024-11-15T15:57:58.941Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T15:58:00.533Z info: # rows in table: 1
2024-11-15T15:58:00.533Z info: # reload tasks in table: 1
2024-11-15T15:58:00.533Z info: # external program tasks in table: 0
2024-11-15T15:58:00.548Z info:
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ # reload tasks: 1, # external program tasks: 0, # rows in table: 1                                                                                                                                                                                                                                       │
├──────────────┬───────────┬────────────────────────────────────────────────┬──────────────────────────────────────┬──────────────┬──────────────┬──────────────┬──────────────────────────────────────┬────────────────┬────────────────────┬──────────────────┬────────────────────────┬─────────────────┤
│ Task counter │ Task type │ Task name                                      │ Task id                              │ Task enabled │ Task timeout │ Task retries │ App id                               │ Partial reload │ Manually triggered │ Ext program path │ Ext program parameters │ Tags            │
├──────────────┼───────────┼────────────────────────────────────────────────┼──────────────────────────────────────┼──────────────┼──────────────┼──────────────┼──────────────────────────────────────┼────────────────┼────────────────────┼──────────────────┼────────────────────────┼─────────────────┤
│ 1            │ Reload    │ Reload task of Test data - NYC parking tickets │ 09b3c78f-04dd-45e3-a4bf-1b074d6572fa │ true         │ 1440         │ 0            │ 3242f03a-079d-4125-bef2-7b65c9e96231 │                │                    │                  │                        │ Butler 5.0 demo │
└──────────────┴───────────┴────────────────────────────────────────────────┴──────────────────────────────────────┴──────────────┴──────────────┴──────────────┴──────────────────────────────────────┴────────────────┴────────────────────┴──────────────────┴────────────────────────┴─────────────────┘

Example: Save task to disk file in tabular format

Saving a task table to disk file (Excel and CSV file formats supported) is done via the task-get command, adding --output-format table, --output-dest file, --output-file-format csv and --output-file-name <filename> options.
Here the most common task fileds together with task tags are included in the table written to a CSV file:

.\ctrl-q.exe qseow task-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format table `
  --output-dest file `
  --table-details common tag `
  --output-file-format csv `
  --output-file-name tasktable.csv
2024-11-15T15:59:52.405Z info: -----------------------------------------------------------
2024-11-15T15:59:52.408Z info: | Ctrl-Q
2024-11-15T15:59:52.408Z info: |
2024-11-15T15:59:52.408Z info: | Version      : 4.0.0
2024-11-15T15:59:52.408Z info: | Log level    : info
2024-11-15T15:59:52.408Z info: |
2024-11-15T15:59:52.409Z info: | Command      : task-get
2024-11-15T15:59:52.409Z info: |              : get info about one or more tasks
2024-11-15T15:59:52.409Z info: |
2024-11-15T15:59:52.409Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T15:59:52.411Z info: |
2024-11-15T15:59:52.411Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T15:59:52.411Z info: ----------------------------------------------------------
2024-11-15T15:59:52.411Z info:
2024-11-15T15:59:52.794Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T15:59:55.111Z info: ✅ Writing task table to disk file "tasktable.csv".

Example: Save task to disk file as JSON

If task defintions should be read by some other system the task definitions can be saved as JSON.
Here only the most basic task info included via the --table-details option.

.\ctrl-q.exe qseow task-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format table `
  --output-dest file `
  --table-details common `
  --output-file-format json `
  --output-file-name tasks.json
2024-11-15T16:00:47.364Z info: -----------------------------------------------------------
2024-11-15T16:00:47.368Z info: | Ctrl-Q
2024-11-15T16:00:47.368Z info: |
2024-11-15T16:00:47.369Z info: | Version      : 4.0.0
2024-11-15T16:00:47.369Z info: | Log level    : info
2024-11-15T16:00:47.369Z info: |
2024-11-15T16:00:47.369Z info: | Command      : task-get
2024-11-15T16:00:47.369Z info: |              : get info about one or more tasks
2024-11-15T16:00:47.370Z info: |
2024-11-15T16:00:47.370Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T16:00:47.370Z info: |
2024-11-15T16:00:47.371Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T16:00:47.371Z info: ----------------------------------------------------------
2024-11-15T16:00:47.371Z info:
2024-11-15T16:00:47.750Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T16:00:50.125Z info: ✅ Writing task table to disk file "tasks.json".

The resulting JSON file looks like this:

[
    [
        "Task counter",
        "Task type",
        "Task name",
        "Task id",
        "Task enabled",
        "Task timeout",
        "Task retries",
        "App id",
        "Partial reload",
        "Manually triggered"
    ],
    [
        1,
        "Reload",
        "Manually triggered reload of Always failing reload (no delay)",
        "0d815a99-1ca3-4131-a398-6878bd735fd8",
        true,
        1440,
        0,
        "deba4bcf-47e4-472e-97b2-4fe8d6498e11",
        false,
        true
    ],
    [
        2,
        "Reload",
        "Manually triggered reload of App1 🏆",
        "b37f8034-faee-4e9b-bbca-5aba0cdf5df2",
        true,
        1440,
        0,
        "26634113-9163-44e4-a879-d87817d6e887",
        false,
        true
    ],
...
...
]

List tasks as network graph

This command provides an interactive network graph view of reload tasks and external program tasks.

First Ctrl-Q will retrieve information about all reload and external program tasks from the Qlik Sense repository service (QRS).
This includes information about last execution results for the tasks.

A web server is then started on the local computer where Ctrl-Q is running, serving a web page with the network graph in it.
A link to the web page is shown in the console where Ctrl-Q is running.
In the example below the link is http://localhost:3000.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow task-vis --help
Usage: ctrl-q qseow task-vis [options]

visualise task network

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --port <port>                 Qlik Sense repository service (QRS) port (usually 4242 for cert auth, 443 for jwt auth) (default: "4242")
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --vis-host <host>             host for visualisation server (default: "localhost")
  --vis-port <port>             port for visualisation server (default: "3000")
  -h, --help                    display help for command

Example

On Windows using PowerShell it can look like this:

.\ctrl-q.exe qseow task-vis `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-type cert `
  --auth-user-dir LAB `
  --auth-user-id goran
2024-11-19T07:10:20.307Z info: -----------------------------------------------------------
2024-11-19T07:10:20.307Z info: | Ctrl-Q
2024-11-19T07:10:20.307Z info: |
2024-11-19T07:10:20.307Z info: | Version      : 4.1.0
2024-11-19T07:10:20.307Z info: | Log level    : info
2024-11-19T07:10:20.307Z info: |
2024-11-19T07:10:20.307Z info: | Command      : task-vis
2024-11-19T07:10:20.307Z info: |              : visualise task network
2024-11-19T07:10:20.307Z info: |
2024-11-19T07:10:20.307Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T07:10:20.307Z info: |
2024-11-19T07:10:20.307Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T07:10:20.307Z info: ----------------------------------------------------------
2024-11-19T07:10:20.307Z info:
2024-11-19T07:10:22.439Z info: Using vis.js to visualize tasks, more info at https://github.com/visjs/vis-network
2024-11-19T07:10:22.439Z info:
2024-11-19T07:10:22.439Z info: Task visualization server listening on http://localhost:3000
2024-11-19T07:10:22.439Z info: Press Ctrl-C to quit.

Ctrl-clicking (on Windows. Use Cmd-Clik on macOS) on the link will open the network graph in a browser:

Qlik Sense task network graph

Node types

Node type Shape Description
Schema trigger Triangle A schema trigger is a time-based task trigger.
Orange if enabled, gray when disabled
Composite trigger Hexagon If a task’s composite trigger has two or more upstream triggers the composite trigger will be shown as a hexagon.
Orange if enabled, gray when disabled.

If the composite trigger only has one upstream task the composite trigger will not be shown in the graph. In this case the arrow from the upstream task will go directly to the downstream task.
Reload task Rectangle A reload task.
Green when last reload finished successfully, red when last reload failed, gray when task is disabled, blue when task has never been started.
External program task Elipse An external program task.
Green when last run finished successfully, red when last run failed, gray when task is disabled, blue when task has never been started.

User interface

The user interface consists of a toolbar at the top of the page and the network graph itself.

The toolbar has a fixed position and size at the top of the page, while the network graph will resize to fit the available space below the toolbar.

Collapsing/expanding node clusters

Networks with many tasks can be hard to read.
To make it easier to read such networks Ctrl-Q offers the possibility to collapse/expand node clusters and/or leaf nodes.

  • A node cluster is a group of nodes that are connected to each other.
  • A leaf node is a node that does not have any downstream nodes.

Here is an example where the “Cluster leaves” button has been clicked a few times.
Note the circular task chain that becomes very easy to see when the leaf nodes are collapsed:

Qlik Sense task network graph

Expanding the leaf nodes again makes is done by clicking the “Uncluster all” button.

Legend and network graph configuration

The “Legend” button will toggle the floating (also moveable!) legend window on/off.

The “Network config” button will toggle a network configuration pane to the left on/off:

Qlik Sense task network graph

The network configuration pane makes it possible to fine-tune the parameters used when creating the network graph.
Things like gravity, spring stiffness, overlap stragegy etc. can be adjusted.

If the network graph is hard to read it can be worth trying different values for these parameters.

1.10 - Variables

In-app variables.

Page contents:


List variables in a Sense app

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow variable-get --help
Usage: ctrl-q qseow variable-get [options]

get variable definitions in one or more apps

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --engine-port <port>          Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --qrs-port <port>             Qlik Sense repository service (QRS) port (usually 4747 for cert auth, 443 for jwt auth) (default: "4242")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id...>              Qlik Sense app ID(s) to get variables from
  --app-tag <tag...>            Qlik Sense app tag(s) to get variables
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --id-type <type>              type of identifier passed in the --variable option (choices: "id", "name", default: "name")
  --variable <ids...>           variables to retrieve. If not specified all variables will be retrieved
  --output-format <format>      output format (choices: "json", "table", default: "json")
  -h, --help                    display help for command

Example

The command below lists certain variables (named Ctrl-Q variable 1, TimestampFormat, var1 and vVar1) in apps matching appId a3e0f5d2-000a-464f-998d-33d333b175d7 and app tags Ctrl-Q variable 1 and Ctrl-Q variable 2.

If the --variable option is not included all variables will be included in the table.

Use --output-format json to get the results as JSON.

.\ctrl-q.exe qseow variable-get `
    --host pro2-win1.lab.ptarmiganlabs.net `
    --qrs-port 4242 `
    --auth-user-dir LAB `
    --auth-user-id goran `
    --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
    --app-tag 'Ctrl-Q variable 1' 'Ctrl-Q variable 2' `
    --id-type name `
    --variable 'Ctrl-Q variable 1' 'TimestampFormat' 'var1' 'vVar1' `
    --output-format table
2024-11-15T16:15:45.620Z info: -----------------------------------------------------------
2024-11-15T16:15:45.623Z info: | Ctrl-Q
2024-11-15T16:15:45.623Z info: |
2024-11-15T16:15:45.623Z info: | Version      : 4.0.0
2024-11-15T16:15:45.623Z info: | Log level    : info
2024-11-15T16:15:45.625Z info: |
2024-11-15T16:15:45.625Z info: | Command      : variable-get
2024-11-15T16:15:45.625Z info: |              : get variable definitions in one or more apps
2024-11-15T16:15:45.625Z info: |
2024-11-15T16:15:45.626Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T16:15:45.626Z info: |
2024-11-15T16:15:45.626Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T16:15:45.626Z info: ----------------------------------------------------------
2024-11-15T16:15:45.626Z info:
2024-11-15T16:15:46.050Z info: Found 5 apps to process
2024-11-15T16:15:46.236Z info: Getting variables from app f16fa63d-54c7-4c8d-81f1-2d084d46bcfe, "Minecraft Metrics"
2024-11-15T16:15:46.614Z info: Getting variables from app e377d9b5-231a-4795-800f-3649983647dd, "LDAP lab"
2024-11-15T16:15:47.080Z info: Getting variables from app a3e0f5d2-000a-464f-998d-33d333b175d7, "Sheet thumbnails demo app"
2024-11-15T16:15:47.758Z info: Getting variables from app d1ace221-b80e-4754-98ea-3d0a9ebc9632, "Residential energy analysis"
2024-11-15T16:15:48.239Z info: Getting variables from app c840670c-7178-4a5e-8409-ba2da69127e2, "Meetup.com"
2024-11-15T16:15:48.893Z info:
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ In-app variables                                                                                                                                                                                                                                                                                                                                                     │
├──────────────────────────────────────┬─────────────────────────────┬──────────────────────────────────────┬─────────────────┬───────────────────┬──────────┬───────────────────────────┬─────────────┬───────────────────┬──────────────────────────┬──────────────────────────┬────────────────────┬──────┬───────┬───────────────────────────────┬─────────────────┤
│ App ID                               │ App name                    │ Variable ID                          │ Variable name   │ Description       │ Type     │ Definition                │ Is reserved │ Is script created │ Created date             │ Modified date            │ Engine object type │ Size │ Title │ Privileges                    │ Tags            │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ f16fa63d-54c7-4c8d-81f1-2d084d46bcfe │ Minecraft Metrics           │ cd5eb1a8-bd19-42f6-8d58-55905297572b │ TimestampFormat │                   │ variable │ M/D/YYYY h:mm:ss[.fff] TT │ true        │ true              │                          │                          │                    │      │       │ read,update,delete            │                 │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ e377d9b5-231a-4795-800f-3649983647dd │ LDAP lab                    │ 56c3db7d-050f-4cf0-8249-59fd817ae782 │ vVar1           │                   │ variable │ asfdsdf                   │             │                   │ 2022-05-17T07:17:14.422Z │ 2024-03-12T09:05:08.439Z │                    │ -1   │       │ read,update,delete,exportdata │                 │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ e377d9b5-231a-4795-800f-3649983647dd │ LDAP lab                    │ c1a99293-51d0-426b-bdb7-a43b2d896dc9 │ TimestampFormat │                   │ variable │ M/D/YYYY h:mm:ss[.fff] TT │ true        │ true              │                          │                          │                    │      │       │ read,update,delete            │                 │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ a3e0f5d2-000a-464f-998d-33d333b175d7 │ Sheet thumbnails demo app   │ 0155e35e-8054-4896-9dd7-d947405f3a90 │ vVar1           │ vVar1 description │ variable │ ='abc' & '123'            │             │                   │ 2021-06-03T22:04:52.283Z │ 2023-10-31T06:12:00.194Z │                    │ -1   │       │ read,update,delete,exportdata │ varTag1,varTag2 │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ a3e0f5d2-000a-464f-998d-33d333b175d7 │ Sheet thumbnails demo app   │ 8b9ed9b7-7db9-420f-8c00-308e19befd54 │ TimestampFormat │                   │ variable │ M/D/YYYY h:mm:ss[.fff] TT │ true        │ true              │                          │                          │                    │      │       │ read,update,delete            │                 │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ a3e0f5d2-000a-464f-998d-33d333b175d7 │ Sheet thumbnails demo app   │ 548828d1-4e83-4e57-a0ed-b94119fc46ad │ var1            │                   │ variable │ This is variable 1        │             │ true              │                          │                          │                    │      │       │ read,update,delete            │                 │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ d1ace221-b80e-4754-98ea-3d0a9ebc9632 │ Residential energy analysis │ 185378fa-4835-47db-b142-ecffb4ffe951 │ TimestampFormat │                   │ variable │ M/D/YYYY h:mm:ss[.fff] TT │ true        │ true              │                          │                          │                    │      │       │ read,update,delete            │                 │
├──────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────┼─────────────────┼───────────────────┼──────────┼───────────────────────────┼─────────────┼───────────────────┼──────────────────────────┼──────────────────────────┼────────────────────┼──────┼───────┼───────────────────────────────┼─────────────────┤
│ c840670c-7178-4a5e-8409-ba2da69127e2 │ Meetup.com                  │ 3773a685-d3ce-453f-9e7a-d88514207dbe │ TimestampFormat │                   │ variable │ M/D/YYYY h:mm:ss[.fff] TT │ true        │ true              │                          │                          │                    │      │       │ read,update,delete            │                 │
└──────────────────────────────────────┴─────────────────────────────┴──────────────────────────────────────┴─────────────────┴───────────────────┴──────────┴───────────────────────────┴─────────────┴───────────────────┴──────────────────────────┴──────────────────────────┴────────────────────┴──────┴───────┴───────────────────────────────┴─────────────────┘

Delete variables in a Sense app

There are three kinds of variables in Sense:

  1. Variables created in the load script using let or set statements. These variables will get the property “Is script created” set to true in the output table created by Ctrl-Q.
  2. Variables created in the Sense app development UI. These will have a blank (=undefined) value in “Is script created”.
  3. Protected variables of different kinds, these have special meanings in the load script. Examples include system variables, error variables and Number interpretation variables.
    These have the property “Is reserved” set to true in the variable table created by Ctrl-Q’s variable-get command.
    All the variables that are automatically inserted at the beginning of new apps are of this kind, see image below.

Qlik sense variables with special meaning

The protected variables cannot be deleted using the app development UI or by Ctrl-Q, neither can script-created variables.
To remove script created variables you must first remove them from the app’s load script and then reload the app. Those variables re

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow variable-delete --help
Usage: ctrl-q qseow variable-delete [options]

delete one or more variables in one or more apps

Options:
  --log-level <level>           log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                 Qlik Sense server IP/FQDN
  --engine-port <port>          Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --qrs-port <port>             Qlik Sense repository service (QRS) port (usually 4242 for cert auth, 443 for jwt auth) (default: "4242")
  --schema-version <string>     Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id...>              Qlik Sense app ID(s) to get variables from
  --app-tag <tag...>            Qlik Sense app tag(s) to get variables
  --virtual-proxy <prefix>      Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>         https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>   user directory for user to connect with
  --auth-user-id <userid>       user ID for user to connect with
  -a, --auth-type <type>        authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>       Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>   Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>  Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>              JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --id-type <type>              type of identifier passed in the --variable option (choices: "id", "name", default: "name")
  --variable <ids...>           variables to retrieve. If not specified all variables will be retrieved
  --delete-all                  delete all variables
  --dry-run                     do a dry run, i.e. do not delete anything - just show what would be deleted
  -h, --help                    display help for command

Example

The example below deletes certain variables in several apps.
The --dry-run option means Ctrl-Q will not delete any variables, but rather show what would be deleted.

If all variables should be deleted the --delete-all option can be used.
Note that if --delete-all is used --id-type and --variable must not be used.

.\ctrl-q.exe qseow variable-delete `
    --auth-type cert `
    --host pro2-win1.lab.ptarmiganlabs.net `
    --auth-user-dir LAB `
    --auth-user-id goran `
    --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 2933711d-6638-41d4-a2d2-6dd2d965208b `
    --app-tag 'Ctrl-Q variable 1' 'Ctrl-Q variable 2' `
    --id-type name `
    --variable a1 a2 a3 vVar1 `
    --dry-run
2024-11-15T16:17:32.186Z info: -----------------------------------------------------------
2024-11-15T16:17:32.190Z info: | Ctrl-Q
2024-11-15T16:17:32.190Z info: |
2024-11-15T16:17:32.190Z info: | Version      : 4.0.0
2024-11-15T16:17:32.190Z info: | Log level    : info
2024-11-15T16:17:32.192Z info: |
2024-11-15T16:17:32.192Z info: | Command      : variable-delete
2024-11-15T16:17:32.192Z info: |              : delete one or more variables in one or more apps
2024-11-15T16:17:32.192Z info: |
2024-11-15T16:17:32.193Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T16:17:32.193Z info: |
2024-11-15T16:17:32.193Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T16:17:32.194Z info: ----------------------------------------------------------
2024-11-15T16:17:32.194Z info:
2024-11-15T16:17:32.717Z info: ------------------------
2024-11-15T16:17:32.717Z info: Deleting variables in app 2933711d-6638-41d4-a2d2-6dd2d965208b, "Ctrl-Q CLI"
2024-11-15T16:17:33.235Z info: DRY RUN: Delete of variable "a1" in app 2933711d-6638-41d4-a2d2-6dd2d965208b "Ctrl-Q CLI" would happen here
2024-11-15T16:17:33.241Z warn: Variable "a2" does not exist in app 2933711d-6638-41d4-a2d2-6dd2d965208b "Ctrl-Q CLI"
2024-11-15T16:17:33.241Z info: DRY RUN: Delete of variable "a3" in app 2933711d-6638-41d4-a2d2-6dd2d965208b "Ctrl-Q CLI" would happen here
2024-11-15T16:17:33.241Z warn: Variable "vVar1" does not exist in app 2933711d-6638-41d4-a2d2-6dd2d965208b "Ctrl-Q CLI"
2024-11-15T16:17:33.241Z info: ------------------------
2024-11-15T16:17:33.241Z info: Deleting variables in app f16fa63d-54c7-4c8d-81f1-2d084d46bcfe, "Minecraft Metrics"
2024-11-15T16:17:33.680Z warn: Variable "a1" does not exist in app f16fa63d-54c7-4c8d-81f1-2d084d46bcfe "Minecraft Metrics"
2024-11-15T16:17:33.682Z warn: Variable "a2" does not exist in app f16fa63d-54c7-4c8d-81f1-2d084d46bcfe "Minecraft Metrics"
2024-11-15T16:17:33.683Z warn: Variable "a3" does not exist in app f16fa63d-54c7-4c8d-81f1-2d084d46bcfe "Minecraft Metrics"
2024-11-15T16:17:33.683Z warn: Variable "vVar1" does not exist in app f16fa63d-54c7-4c8d-81f1-2d084d46bcfe "Minecraft Metrics"
2024-11-15T16:17:33.683Z info: ------------------------
2024-11-15T16:17:33.683Z info: Deleting variables in app e377d9b5-231a-4795-800f-3649983647dd, "LDAP lab"
2024-11-15T16:17:34.103Z warn: Variable "a1" does not exist in app e377d9b5-231a-4795-800f-3649983647dd "LDAP lab"
2024-11-15T16:17:34.106Z warn: Variable "a2" does not exist in app e377d9b5-231a-4795-800f-3649983647dd "LDAP lab"
2024-11-15T16:17:34.106Z warn: Variable "a3" does not exist in app e377d9b5-231a-4795-800f-3649983647dd "LDAP lab"
2024-11-15T16:17:34.107Z info: DRY RUN: Delete of variable "vVar1" in app e377d9b5-231a-4795-800f-3649983647dd "LDAP lab" would happen here
2024-11-15T16:17:34.107Z info: ------------------------
2024-11-15T16:17:34.107Z info: Deleting variables in app a3e0f5d2-000a-464f-998d-33d333b175d7, "Sheet thumbnails demo app"
2024-11-15T16:17:34.855Z info: DRY RUN: Delete of variable "a1" in app a3e0f5d2-000a-464f-998d-33d333b175d7 "Sheet thumbnails demo app" would happen here
2024-11-15T16:17:34.859Z info: DRY RUN: Delete of variable "a2" in app a3e0f5d2-000a-464f-998d-33d333b175d7 "Sheet thumbnails demo app" would happen here
2024-11-15T16:17:34.859Z warn: Variable "a3" does not exist in app a3e0f5d2-000a-464f-998d-33d333b175d7 "Sheet thumbnails demo app"
2024-11-15T16:17:34.860Z info: DRY RUN: Delete of variable "vVar1" in app a3e0f5d2-000a-464f-998d-33d333b175d7 "Sheet thumbnails demo app" would happen here
2024-11-15T16:17:34.860Z info: ------------------------
2024-11-15T16:17:34.860Z info: Deleting variables in app d1ace221-b80e-4754-98ea-3d0a9ebc9632, "Residential energy analysis"
2024-11-15T16:17:35.326Z warn: Variable "a1" does not exist in app d1ace221-b80e-4754-98ea-3d0a9ebc9632 "Residential energy analysis"
2024-11-15T16:17:35.330Z warn: Variable "a2" does not exist in app d1ace221-b80e-4754-98ea-3d0a9ebc9632 "Residential energy analysis"
2024-11-15T16:17:35.330Z warn: Variable "a3" does not exist in app d1ace221-b80e-4754-98ea-3d0a9ebc9632 "Residential energy analysis"
2024-11-15T16:17:35.330Z warn: Variable "vVar1" does not exist in app d1ace221-b80e-4754-98ea-3d0a9ebc9632 "Residential energy analysis"
2024-11-15T16:17:35.330Z info: ------------------------
2024-11-15T16:17:35.330Z info: Deleting variables in app c840670c-7178-4a5e-8409-ba2da69127e2, "Meetup.com"
2024-11-15T16:17:35.842Z warn: Variable "a1" does not exist in app c840670c-7178-4a5e-8409-ba2da69127e2 "Meetup.com"
2024-11-15T16:17:35.845Z warn: Variable "a2" does not exist in app c840670c-7178-4a5e-8409-ba2da69127e2 "Meetup.com"
2024-11-15T16:17:35.845Z warn: Variable "a3" does not exist in app c840670c-7178-4a5e-8409-ba2da69127e2 "Meetup.com"
2024-11-15T16:17:35.845Z warn: Variable "vVar1" does not exist in app c840670c-7178-4a5e-8409-ba2da69127e2 "Meetup.com"

1.11 - Export

Exporting various information from Qlik Sense.

Page contents:


Export tasks to Excel file

See this page for details on how to export task definitions to a disk file:
Save task to disk in tabular format

Export apps to QVF files

This command exports Sense apps to QVF files, with or without data.

The command optionally also creates an Excel file with metadata about each app, in the same format used by the app-import command.
It is thus possible to first export apps and get a metadata Excel file, then import those QVFs into another Sense server, using the Excel file to control which apps are imported.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow app-export --help
Usage: ctrl-q qseow app-export [options]

export Qlik Sense apps to QVF files on disk.

Options:
  --log-level <level>                log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                      Qlik Sense server IP/FQDN
  --port <port>                      Qlik Sense repository service (QRS) port (usually 4242 for cert auth, 443 for jwt auth) (default: "4242")
  --schema-version <string>          Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>           Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>              https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>        user directory for user to connect with
  --auth-user-id <userid>            user ID for user to connect with
  -a, --auth-type <type>             authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>            Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>        Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>       Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>                   JSON Web Token (JWT) to use for authentication with Qlik Sense server
  --app-id <ids...>                  use app IDs to select which apps to export
  --app-tag <tags...>                use app tags to select which apps to export
  --app-published                    export all published apps  (default: false)
  --output-dir <directory>           relative or absolut path in which QVF files should be stored. (default: "qvf-export")
  --qvf-name-format <format...>      structure of QVF file name format (choices: "app-id", "app-name", "export-date", "export-time", default: ["app-name"])
  --qvf-name-separator <separator>   character used to separate parts of the QVF file name (choices: "-", "--", "_", "__", default: "_")
  --qvf-overwrite                    overwrite existing QVF files without asking
  --exclude-app-data <true|false>    exclude or include app data in QVF file (default: true)
  --limit-export-count <number>      export at most x number of apps. Defaults to 0 = no limit (default: 0)
  --sleep-app-export <milliseconds>  Wait this long before continuing after each app has been exported. Defaults to 1000 = 1 second (default: 1000)
  --metadata-file-create             create a separate file with information about all exported apps
  --metadata-file-name <name>        file name to store app metadata in (default: "app_export.xlsx")
  --metadata-file-format <format>    file type/format (choices: "excel", default: "excel")
  --metadata-file-overwrite          overwrite app metadata file without asking
  --dry-run                          do a dry run, i.e. do not export any apps - just show what would be done
  -h, --help                         display help for command

Example

This example will

  • Export apps (including the data in them) that have either of two different tags set, plus two apps identified by app id.
  • If the QVF files exist a confirmation text will be shown for each existing app.
  • The name of the QVF files will be <app name>_<exportdate>.qvf.
  • QVF files will be stored in a subdirectory qvf-export.
  • An Excel file will be created, containing select metadata about the apps.
  • The certificate files are specifically named in the command, and are stored in a subdirectory cert.
  • Some of the apps are already present in the qvf-export directory, so the command will ask for confirmation before overwriting them.
.\ctrl-q.exe qseow app-export `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-cert-file ./cert/client.pem `
  --auth-cert-key-file ./cert/client_key.pem `
  --auth-root-cert-file ./cert/root.pem `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-dir qvf-export `
  --app-tag apiCreated "Ctrl-Q import" `
  --app-id eb3ab049-d007-43d3-93da-5962f9208c65 2933711d-6638-41d4-a2d2-6dd2d965208b `
  --exclude-app-data false `
  --qvf-name-format app-name export-date `
  --qvf-name-separator _ `
  --metadata-file-create
2024-11-19T05:53:01.685Z info: -----------------------------------------------------------
2024-11-19T05:53:01.685Z info: | Ctrl-Q
2024-11-19T05:53:01.685Z info: |
2024-11-19T05:53:01.685Z info: | Version      : 4.1.0
2024-11-19T05:53:01.685Z info: | Log level    : info
2024-11-19T05:53:01.700Z info: |
2024-11-19T05:53:01.700Z info: | Command      : app-export
2024-11-19T05:53:01.700Z info: |              : export Qlik Sense apps to QVF files on disk.
2024-11-19T05:53:01.700Z info: |
2024-11-19T05:53:01.700Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T05:53:01.700Z info: |
2024-11-19T05:53:01.700Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T05:53:01.700Z info: ----------------------------------------------------------
2024-11-19T05:53:01.700Z info:
2024-11-19T05:53:01.700Z info: Export apps to directory "C:/tools/ctrl-q/qvf-export"
2024-11-19T05:53:03.388Z info: Number of apps to export: 16
2024-11-19T05:53:04.482Z info: ------------------------------------
2024-11-19T05:53:04.482Z info: 1 of 16: App [eb3ab049-d007-43d3-93da-5962f9208c65] "User retention.qvf", download starting
2024-11-19T05:53:04.810Z info: ✅ App [eb3ab049-d007-43d3-93da-5962f9208c65] "User retention.qvf", download complete. Size=360448 bytes
2024-11-19T05:53:06.778Z info: ------------------------------------
2024-11-19T05:53:06.778Z info: 2 of 16: App [2933711d-6638-41d4-a2d2-6dd2d965208b] "Ctrl-Q CLI.qvf", download starting
2024-11-19T05:53:07.232Z info: ✅ App [2933711d-6638-41d4-a2d2-6dd2d965208b] "Ctrl-Q CLI.qvf", download complete. Size=720896 bytes
2024-11-19T05:53:08.889Z info: ------------------------------------
2024-11-19T05:53:08.889Z info: 3 of 16: App [e9d2f9b2-b598-480e-b84f-4c5d34467f6f] "Performance review_2022-03-28.qvf", download starting
2024-11-19T05:53:09.232Z info: ✅ App [e9d2f9b2-b598-480e-b84f-4c5d34467f6f] "Performance review_2022-03-28.qvf", download complete. Size=327680 bytes
2024-11-19T05:53:11.044Z info: ------------------------------------
2024-11-19T05:53:11.044Z info: 4 of 16: App [5733046b-df34-4989-bd33-56cde5ff779d] "App 2.qvf", download starting
2024-11-19T05:53:11.325Z info: ✅ App [5733046b-df34-4989-bd33-56cde5ff779d] "App 2.qvf", download complete. Size=245760 bytes
2024-11-19T05:53:13.044Z info: ------------------------------------
2024-11-19T05:53:13.044Z info: 5 of 16: App [b676ea6d-fd75-4fdf-a3b7-2f318a043876] "App 1.qvf", download starting
2024-11-19T05:53:13.341Z info: ✅ App [b676ea6d-fd75-4fdf-a3b7-2f318a043876] "App 1.qvf", download complete. Size=245760 bytes
2024-11-19T05:53:14.982Z info:
                                  Destination file "C:\tools\ctrl-q\qvf-export\App 1_2024-11-19.qvf" exists. Do you want to overwrite it? (y/n) y
2024-11-19T05:53:17.927Z info:
2024-11-19T05:53:17.927Z info: ------------------------------------
2024-11-19T05:53:17.927Z info: 6 of 16: App [448c5969-adca-427a-a502-7859aadec93e] "App 1.qvf", download starting
2024-11-19T05:53:18.240Z info: ✅ App [448c5969-adca-427a-a502-7859aadec93e] "App 1.qvf", download complete. Size=245760 bytes
...
...
2024-11-19T05:53:45.611Z info:
2024-11-19T05:53:45.611Z info: ------------------------------------
2024-11-19T05:53:45.611Z info: 16 of 16: App [5fb8db40-f4b2-49fe-8d72-acd12d8c82bd] "App 2.qvf", download starting
2024-11-19T05:53:45.877Z info: ✅ App [5fb8db40-f4b2-49fe-8d72-acd12d8c82bd] "App 2.qvf", download complete. Size=245760 bytes
2024-11-19T05:53:46.892Z info: ------------------------------------
2024-11-19T05:53:46.892Z info:
                                  App metadata file "C:\tools\ctrl-q\qvf-export\app_export.xlsx" exists. Do you want to overwrite it? (y/n) y
2024-11-19T05:53:47.799Z info:
2024-11-19T05:53:47.815Z info: ✅ Done writing app metadata file "app_export.xlsx" to disk

The qvf-export directory now contains these files:

dir .\qvf-export\
    Directory: C:\tools\ctrl-q\qvf-export


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        12/03/2024     10:26         180224 Always failing reload (no delay)_2024-03-12.qvf
-a----        19/11/2024     06:53         180224 Always failing reload (no delay)_2024-11-19.qvf
-a----        12/03/2024     10:27         245760 App 1_2024-03-12.qvf
-a----        19/11/2024     06:53         245760 App 1_2024-11-19.qvf
-a----        12/03/2024     10:27         245760 App 2_2024-03-12.qvf
-a----        19/11/2024     06:53         245760 App 2_2024-11-19.qvf
-a----        19/11/2024     06:53          24398 app_export.xlsx
-a----        12/03/2024     10:26         720896 Ctrl-Q CLI_2024-03-12.qvf
-a----        19/11/2024     06:53         720896 Ctrl-Q CLI_2024-11-19.qvf
-a----        12/03/2024     10:26         327680 Performance review_2022-03-28_2024-03-12.qvf
-a----        19/11/2024     06:53         327680 Performance review_2022-03-28_2024-11-19.qvf
-a----        12/03/2024     10:26         360448 User retention_2024-03-12.qvf
-a----        19/11/2024     06:53         360448 User retention_2024-11-19.qvf

The format of the created Excel file is almost identical to the one used when importing apps from QVF files, described here.

The only difference is that the app export format includes an “App id” column, which is not required when importing apps.

App import will however work just fine if there is an “App id” column present, it just won’t be used for anything.

1.12 - Import

Import various information into Qlik Sense

Save time and avoid manual errors by automating the import of various information into Qlik Sense.

1.12.1 - Apps

Import apps into Qlik Sense

Page contents:


All example below use Windows Terminal/PowerShell.

Import apps from QVF files

.QVF files are Sense apps stored on disk.
Ctrl-Q’s app-import command does bulk import of such QVF files, as well as setting tags and custom properties on the created apps.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow app-import --help
Usage: ctrl-q qseow app-import [options]

import apps/upload QVF files on disk to Sense based on definitions in Excel file.

Options:
  --log-level <level>                log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                      Qlik Sense server IP/FQDN
  --port <port>                      Qlik Sense repository service (QRS) port (usually 4242 for cert auth, 443 for jwt auth) (default: "4242")
  --schema-version <string>          Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>           Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>              https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>        user directory for user to connect with
  --auth-user-id <userid>            user ID for user to connect with
  -a, --auth-type <type>             authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>            Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>        Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>       Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>                   JSON Web Token (JWT) to use for authentication with Qlik Sense server
  -t, --file-type <type>             source file type (choices: "excel", default: "excel")
  --file-name <filename>             file containing app definitions
  --sheet-name <name>                name of Excel sheet where app info is found
  --limit-import-count <number>      import at most x number of apps. Defaults to 0 = no limit (default: 0)
  --sleep-app-upload <milliseconds>  Wait this long before continuing after each app has been uploaded to Sense. Defaults to 1000 = 1 second (default: 1000)
  --dry-run                          do a dry run, i.e. do not import any apps - just show what would be done
  -h, --help                         display help for command

Example

Importing apps defined on the App import sheet of the tasks.xlsx Excel file can be done with a command like this:

.\ctrl-q.exe qseow app-import `
    --auth-type cert `
    --host pro2-win1.lab.ptarmiganlabs.net `
    --auth-cert-file ./cert/client.pem `
    --auth-cert-key-file ./cert/client_key.pem `
    --auth-user-dir LAB `
    --auth-user-id goran `
    --file-name tasks.xlsx `
    --sheet-name "App import"
2024-11-15T16:51:49.662Z info: -----------------------------------------------------------
2024-11-15T16:51:49.666Z info: | Ctrl-Q
2024-11-15T16:51:49.666Z info: |
2024-11-15T16:51:49.666Z info: | Version      : 4.0.0
2024-11-15T16:51:49.666Z info: | Log level    : info
2024-11-15T16:51:49.666Z info: |
2024-11-15T16:51:49.666Z info: | Command      : app-import
2024-11-15T16:51:49.666Z info: |              : import apps/upload QVF files on disk to Sense based on definitions in Excel file.
2024-11-15T16:51:49.666Z info: |
2024-11-15T16:51:49.668Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T16:51:49.668Z info: |
2024-11-15T16:51:49.668Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T16:51:49.668Z info: ----------------------------------------------------------
2024-11-15T16:51:49.668Z info:
2024-11-15T16:51:49.671Z info: Import apps from definitions in file "tasks.xlsx"
2024-11-15T16:51:49.860Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T16:51:49.944Z info: Successfully retrieved 36 custom properties from QSEoW
2024-11-15T16:51:49.979Z info: -------------------------------------------------------------------
2024-11-15T16:51:49.979Z info: Importing apps...
2024-11-15T16:51:49.979Z info: (1) Importing app "App 3" from file "C:/tools/ctrl-q/testdata/App import 3.qvf"
2024-11-15T16:51:54.887Z info: (1, delete-publish) App "App 3" published to stream "Ctrl-Q demo apps", the existing app (if one exists) with the same name in this stream has been deleted. Id of published app: 82123db2-0aa9-443c-a4d5-aab6ce24d7a1
2024-11-15T16:51:54.888Z info: (2) Importing app "App 3" from file "C:/tools/ctrl-q/testdata/App import 3.qvf"
2024-11-15T16:52:01.948Z info: (2, publish-replace) App "App 3" published to stream "Ctrl-Q demo apps", replacing the existing app with the same name. Id of published app: 82123db2-0aa9-443c-a4d5-aab6ce24d7a1
2024-11-15T16:52:01.948Z info: (3) Importing app "App 1" from file "C:/tools/ctrl-q/testdata/App import 1.qvf"
2024-11-15T16:52:06.203Z warn: (3) PUBLISH APP publish-replace: More than one app with the same name "App 1" in the target stream "Ctrl-Q demo apps". Impossible to know which one to replace. Skipping publishing for this app. The uploaded app is still present in the QMC (id=448c5969-adca-427a-a502-7859aadec93e).
2024-11-15T16:52:06.203Z error: (3) Failed publishing app "App 1" to stream "Ctrl-Q demo apps"
2024-11-15T16:52:06.203Z info: (4) Importing app "App 1" from file "C:/tools/ctrl-q/testdata/App import 1.qvf"
2024-11-15T16:52:10.295Z info: (4, publish-another) App "App 1" published to stream "Ctrl-Q demo apps". Id of published app: d1426332-0699-4fd3-8629-77beac8eecae
2024-11-15T16:52:10.295Z info: (5) Importing app "App 1" from file "C:/tools/ctrl-q/testdata/App import 1.qvf"
2024-11-15T16:52:14.320Z warn: (5) PUBLISH APP publish-replace: More than one app with the same name "App 1" in the target stream "Ctrl-Q demo apps". Impossible to know which one to replace. Skipping publishing for this app. The uploaded app is still present in the QMC (id=a4fbfd0c-48a9-4fa6-bb4b-7833dfe05307).
2024-11-15T16:52:14.320Z error: (5) Failed publishing app "App 1" to stream "Ctrl-Q demo apps"
2024-11-15T16:52:14.320Z info: (6) Importing app "App 2" from file "C:/tools/ctrl-q/testdata/App import 2.qvf"
2024-11-15T16:52:17.850Z warn: Stream "Stream does not exist" does not exist.
2024-11-15T16:52:17.851Z error: (6) Failed publishing app "App 2" to stream "Stream does not exist". The uploaded app is still present in the QMC (id=860ea6c4-9861-45c3-9aa4-23dda66f5ee8).
2024-11-15T16:52:17.851Z info: (7) Importing app "App 3" from file "C:/tools/ctrl-q/testdata/App import 3.qvf"
2024-11-15T16:52:23.450Z info: (7, publish-replace) App "App 3" published to stream "Ctrl-Q demo apps", replacing the existing app with the same name. Id of published app: 82123db2-0aa9-443c-a4d5-aab6ce24d7a1

NOTE 1: Qlik Sense implements rate limiting for QVF uploads. This means that if you plan to upload more than 60 QVF files you may be affected by this rate limiting.
Ctrl-Q detects that it’s being rate limited and implements a backoff strategy for retries, waiting longer and longer until it tries again.
Such retries are clearly shown in the Ctrl-Q logs.

The QMC now shows three new apps:

Sense apps imported from QVF files

The Excel file with definitions on what QVF files should be imported, what the apps should be named etc looks like this:

QVF app files that should be imported into Qlik Sense

The available columns in the Excel file are the same as when importing apps as part of task import.
The columns are described on the page describing app importing as part of task imports.

NOTE: A sample defintions Excel file is available in the GitHub repository.

If a valid app owner is specified in the Excel file it will be applied to the new app.
Similarly, if an already existing stream name (or ID of an existing stream) is specified in the Excel file, the new app will be published to that stream.

1.12.2 - Master items

Import master items into Qlik Sense

Page contents:


All example below use Windows Terminal/PowerShell.

Import master items from Excel file

This command imports dimensions and measures defined in an Excel file into master items in a Sense app.

Both single and drill-down dimensions can be created (i.e. the same types that can be created using the Sense web UI), as well as measures.
The same coloring options are available as in the web UI for both dimensions and measures.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow master-item-import --help
Usage: ctrl-q qseow master-item-import [options]

create master items based on definitions in a file on disk

Options:
  --log-level <level>                                          log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                                                Qlik Sense server IP/FQDN
  --port <port>                                                Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth) (default: "4747")
  --schema-version <string>                                    Qlik Sense engine schema version (default: "12.612.0")
  --app-id <id>                                                Qlik Sense app ID
  --virtual-proxy <prefix>                                     Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>                                        https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>                                  user directory for user to connect with
  --auth-user-id <userid>                                      user ID for user to connect with
  -a, --auth-type <type>                                       authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>                                      Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>                                  Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>                                 Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>                                             JSON Web Token (JWT) to use for authentication with Qlik Sense server
  -t, --file-type <type>                                       source file type (choices: "excel", default: "excel")
  --file <filename>                                            file containing master item definitions
  --sheet <name>                                               name of Excel sheet where dim/measure flag column is found
  --col-ref-by <reftype>                                       how to refer to columns in the source file. Options are by name or by position (zero based) (choices: "name", "position", default: "name")
  --col-item-type <column position or name>                    column where dim/measure flag is found. Use "dim-single" in that column to create dimension, "dim-drilldown" for drill-down dimension, "measure" for
                                                               measure (default: "Master item type")
  --col-master-item-name <column position or name>             column number (zero based) or name to use as master item name (default: "Master item name")
  --col-master-item-descr <column position or name>            column number (zero based) or name to use as master item description (default: "Description")
  --col-master-item-label <column position or name>            column number (zero based) or name to use as master item label (default: "Label")
  --col-master-item-expr <column position or name>             column number (zero based) or name to use as master item expression (default: "Expression")
  --col-master-item-tag <column position or name>              column number (zero based) or name to use as master item tags (default: "Tag")
  --col-master-item-color <column position or name>            column number (zero based) or name to use as color for dimensions/measures (default: "Color")
  --col-master-item-per-value-color <column position or name>  column number (zero based) or name to use as per-value/segment color for dimensions/measures (default: "Per value color")
  --sleep-between-imports <milliseconds>                       sleep this many milliseconds between imports. Set to 0 to disable (default: 1000)
  --limit-import-count <number>                                import at most x number of master items from the Excel file. Defaults to 0 = no limit (default: 0)
  --dry-run                                                    do a dry run, i.e. do not create or update anything - just show what would be done
  -h, --help                                                   display help for command

There are several options that allow for a great deal of flexibility.
For example, the --col-ref-by option determines whether the --col-master-item-... options refer to columns by position or name. Column names will in most cases be easier to read and understand, but sometimes a zero-based column position might be preferred.

Similarly those --col-master-item-... options let you use your own column names in the source file.

By adding the --help option when running Ctrl-Q you get a list of all available options for the master-item-import command.
--help can be added to any Ctrl-Q command, even if there are already other options on the command line.

Some other options that might be useful:

  • --dry-run- Don’t actually create or update any master items, just show what would have been done.
  • --limit-import-count - Only import the first N master items from the file. Useful for testing.
  • --sleep-between-imports - Pause for N milliseconds between each imported master item. Useful for decreasing the load on the Sense server.

Notes on using the master-item-import command:

  • Master items are referred to by name. This means that if a master item in the source file already exists in the target Sense app, the app’s master item will be updated.

  • If a master item does not exist in the target app the master item will be created.

  • If a master item does_* exist in the target app its content will be overwritten with the info in the source Excel file.

  • The structure of the Excel file is fairly flexible, but some restrictions apply:

    • The columns can be named anything. Use the --col-item-type and --col-master-item-... columns to tell Ctrl-Q which columns contains what data.
    • The first row in the Excel sheet must contain column headers if columns are referenced by name.
  • Master item names, descriptions and labels can contain almost any characters and there are some restrictions on the length of these strings.

    • See the Qlik Sense help for details.
    • If a master item name or description is too long a warning will be shown and the text will be truncated to the max length allowed by Sense (see the link above).
    • If a master item has more than 30 tags a warning will be shown and only the first 30 tags will be used.
    • If a master item tag is longer than 31 characters a warning will be shown and the tag will be truncated to 31 characters.
    • If a master item expression is too long an error will be shown and Ctrl-Q will exit. Notes on the example below:
  • The (intentional) warning for the incorrectly spelled master item type “measur” (which should have been “measure”, of course).

Example

Now let’s run the command.

.\ctrl-q.exe qseow master-item-import `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --auth-type cert `
  --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
  --file-type excel `
  --file ./ctrl-q-master-items.xlsx `
  --sheet Sales `
  --col-ref-by name `
  --col-item-type "Master item type" `
  --col-master-item-name "Master Item Name" `
  --col-master-item-descr Description `
  --col-master-item-label Label `
  --col-master-item-expr Expression `
  --col-master-item-tag Tag `
  --col-master-item-color Color `
  --col-master-item-per-value-color 'Per value color'
2024-11-19T07:07:31.858Z info: -----------------------------------------------------------
2024-11-19T07:07:31.873Z info: | Ctrl-Q
2024-11-19T07:07:31.873Z info: |
2024-11-19T07:07:31.873Z info: | Version      : 4.1.0
2024-11-19T07:07:31.873Z info: | Log level    : info
2024-11-19T07:07:31.873Z info: |
2024-11-19T07:07:31.873Z info: | Command      : master-item-import
2024-11-19T07:07:31.873Z info: |              : create master items based on definitions in a file on disk
2024-11-19T07:07:31.873Z info: |
2024-11-19T07:07:31.873Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T07:07:31.873Z info: |
2024-11-19T07:07:31.873Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T07:07:31.873Z info: ----------------------------------------------------------
2024-11-19T07:07:31.873Z info:
2024-11-19T07:07:31.873Z info: Import master items from definitions in Excel file "./ctrl-q-master-items.xlsx"
2024-11-19T07:07:32.936Z info: (1/12) Updated existing measure "No. of sold units"
2024-11-19T07:07:33.983Z info: (2/12) Updated existing measure "No. of sold units (LY)"
2024-11-19T07:07:34.998Z info: (3/12) Updated existing measure "Revenue EUR"
2024-11-19T07:07:36.024Z info: (4/12) Updated existing measure "Revenue EUR (LY)"
2024-11-19T07:07:37.040Z info: (5/12) Updated existing measure "Profit EUR"
2024-11-19T07:07:38.068Z warn: (6/12) Found an unknown master item type: "measur". Ignoring this line in the imported file.
2024-11-19T07:07:39.083Z info: (7/12) Updated existing measure "Profit EUR (LY)"
2024-11-19T07:07:40.114Z info: (8/12) Updated existing dimension "Country"
2024-11-19T07:07:41.162Z info: (9/12) Updated existing dimension "Sales month"
2024-11-19T07:07:42.239Z info: (10/12) Updated existing dimension "Salesperson"
2024-11-19T07:07:43.271Z info: (11/12) Updated existing dimension "Color"
2024-11-19T07:07:44.318Z info: (12/12) Updated existing drill-down dimension "DimDrill"
2024-11-19T07:07:45.334Z info: Imported 12 master items from Excel file ./ctrl-q-master-items.xlsx

NOTE: A sample defintions Excel file is available in the GitHub repository. That file contains examples of most combinations of master item types and properties.

How to get correct color JSONs

If colors are to be associated with master items, the colors must be specified in JSON format, in the correct columns in the Excel file.

The easiest way to get the correct JSONs is to create a master item in the Sense web UI, set the master item’s color, and then use Ctrl-Q’s master-item-dim-get and master-item-measure-get commands to view the master item(s), either as a table or as JSON.
This will show you what the structure of the JSON looks like, or even provide you with the correct JSON if you entered the desired color info in the Sense web UI.

Different master item types have different coloring options:

  • Drill-down dimensions
    • A general dimension color set in the Excel file’s column specified by the --col-master-item-color option.
  • Single dimensions
    • A general dimension color set in the Excel file’s column specified by the --col-master-item-color option.
    • A per-value color that can be used to assign different colors to different values of the dimension. Set in the Excel file’s column specified by the --col-master-item-per-value-color option.
  • Measures
    • A general measure color set in the Excel file’s column specified by the --col-master-item-color option.
    • Segment colors that can be used to assign colors to value ranges of the measure. Set in the Excel file’s column specified by the --col-master-item-per-value-color option.

Let’s look at some examples.

Here we want to get the JSON for the color of the master dimension “Country”.

.\ctrl-q.exe qseow master-item-dim-get `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
  --output-format table

The result will be a rather wide table, where the column named Coloring contains the color JSONs.
The color data for the “Country” dimension looks like this:

Dimension color:
{"color":"#bbbbbb","index":-1}

Value colors:
{"colors":[{"value":"Afghanistan","baseColor":{"color":"#8a85c6","index":-1}},{"value":"Albania","ba
seColor":{"color":"#aaaaaa","index":-1}},{"value":"Algeria","baseColor":{"color":"#a16090","index":9
}}],"nul":{"color":"#c8c7a9","index":16},"oth":{"color":"#ffec6e","index":-1},"pal":null,"single":nu
ll,"usePal":true,"autoFill":true}

Let’s format those as proper JSONs to make them more readable.
These JSONs are what would go into the Excel file’s Color and Per-value color columns.

NOTE 1: If unsure about what data to put in some field, just use the ones returned by the master-item-dim-get command.
NOTE 2: The same concept works for drill-down dimensions and measures.

{
  "color": "#bbbbbb",
  "index": -1
}
{
  "colors": [
    {
      "value": "Afghanistan",
      "baseColor": {
        "color": "#8a85c6",
        "index": -1
      }
    },
    {
      "value": "Albania",
      "baseColor":{
        "color":"#aaaaaa",
        "index":-1}
      },
      {
        "value":"Algeria",
        "baseColor":{
          "color":"#a16090",
          "index":9
        }
      }
  ],
  "nul": {
    "color": "#c8c7a9",
    "index": 16
  },
  "oth": {
    "color": "#ffec6e",
    "index": -1
  },
  "pal": null,
  "single":nu
  ll,
  "usePal": true,
  "autoFill": true
}

1.12.3 - Tasks

Import tasks into Qlik Sense

Page contents:


All examples below use Windows Terminal/PowerShell.

Import tasks from file

Task definitions can be read from CSV or Excel files and then imported into Qlik Sense.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow task-import --help
Usage: ctrl-q qseow task-import [options]

create tasks based on definitions in a file on disk, optionally also importing apps from QVF files.

Options:
  --log-level <level>                log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                      Qlik Sense server IP/FQDN
  --port <port>                      Qlik Sense repository service (QRS) port (usually 4242 for cert auth, 443 for jwt auth) (default: "4242")
  --schema-version <string>          Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>           Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>              https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>        user directory for user to connect with
  --auth-user-id <userid>            user ID for user to connect with
  -a, --auth-type <type>             authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>            Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>        Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>       Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --auth-jwt <jwt>                   JSON Web Token (JWT) to use for authentication with Qlik Sense server
  -t, --file-type <type>             source file type (choices: "excel", "csv", default: "excel")
  --file-name <filename>             file containing task definitions
  --sheet-name <name>                name of Excel sheet where task info is found
  --update-mode <mode>               create new or update existing tasks (choices: "create", default: "create")
  --limit-import-count <number>      import at most x number of tasks from the source file. Defaults to 0 = no limit (default: 0)
  --sleep-app-upload <milliseconds>  Wait this long before continuing after each app has been uploaded to Sense. Defaults to 1000 = 1 second (default: 1000)
  --import-app                       import Sense app QVFs from specified directory
  --import-app-sheet-name <name>     name of Excel sheet where app definitions are found
  --dry-run                          do a dry run, i.e. do not create any reload tasks - just show what would be done
  -h, --help                         display help for command

The options are almost the same irrespective of source file type:

The --sheet-name is only used/valid/relevant when --file-type is set to excel.
Why? Because there are no sheets/tabs in CSV files.

Source file columns for task defintions

The source file format is quite relaxed, but a few rules apply:

  • The first column in the source file must be the task number.
    • This value uniquely identifies each task that should be imported and should be incremented by one for each task.
    • If this first column is empty the whole row will be ignored.
  • All other columns, mandatory and optional, beyond the first one may be placed in any order.
    • For mandatory columns the names listed below must be used (but they can be placed in any order in the file, except the first column).
    • All mandatory columns must be present in the source file, even if they are not used/empty. For example, there may not be any tasks with schema/scheduled triggers, but the schema trigger columns must still be present in the source file.
  • “Counter” columns are used to indicate that rows in the file are associated.
    • All rows involved in defining a certain task have the same “Task counter” value.
    • All rows involved in defining a certain schema or composite event have the same “Event counter” value.
    • All rows involved in defining a certain composite event rule have the same “Rule counter” value.
  • The file format used when exporting task tables to disk is a superset of the format used for task import. It’s thus a good idea to first do a task export, look at the file format and then adopt as needed before importing.

The mandatory columns in the task definition file are:

Column name Comment Description Valid values
Task counter 1 Counter starting at 1. Increments one step for each task. All rows associated with a specific task should have the same value in this column. Integer > 0
Task type 1 Type of task. In the future Ctrl-Q may support more task types. Reload / External program
Task name 1 Name of the task that will be created. Any string. Emojis allowed 🤪.
Task id 1 When creating new tasks a new task ID will always be created. This column is instead used to create task chains: it links a composite trigger in a downstream task with an upstream task via this column’s value. Any string, but to make it easier to verify task chains it’s recommended to use integers or an easy to understand format in this column.
For example “3” or “new-task-3”.
If no downstream task will link to the task being defined, this column can be left empty.
Task enabled 1 Should the created task be enabled or not. 1 / 0 / blank. 1=enabled, 0 or blank=disabled
Task timeout 1 Timeout for the created task, i.e. number of seconds the task is allowed to run before it’s aborted. Seconds
Task retries 1 Number of retries to make if the task execution fails. Integer >= 0
App id 1 The Sense app the task should be associated with. If a valid GUID is specified it’s assumed to be an app id. The task will be associated with that app. If the app id starts with newapp- it is a reference to an app that is imported during the current Ctrl-Q execution. The integer following newapp- is the value in the App counter column in the Excel definitions file.
Partial reload 1 Should the task do a partial or full reload of the app? 1 / 0 / blank. 1=true, 0 or blank=false
Manually triggered 1 Is the task manually triggered or not? 1 / 0 / blank. 1=true, 0 or blank=false
Tags 1 Tags to set on the created task. Format is “tag1 / tag2 / tag with spaces in it”, i.e. separate tag names by “space-forward slash-space”.
Custom properties 1 Custom properties to set on the created task. Format is “CustPropName1=Value1 / CustPropName2=Value2”
Event counter 2 Counter identifying events associated with the task defined in the previous line. One task can have zero or more events associated with it. Integer > 0
Event type 2 Which event type does this line specify? Schema events deal with time-based execution of the task. Composite events are used to build task chains. Schema / Composite
Event name 2 Name of the event. Any string
Event enabled 2 Is event enabled. 1 / 0 / blank. 1=enabled, 0 or blank=disabled
Schema increment option 3 Type of schema event. For reference only, not used when Sense evaluates schema events. once / hourly / daily / weekly / monthly / custom
Schema increment description 3 Structured description of the schema increment option. For reference only, not used when Sense evaluates schema events. Integers separated by space, e.g. “0 0 1 0” for weekly
Daylight savings time 3 Control how the schema event should deal with dayligt savings time. ObserveDaylightSavingTime / PermanentStandardTime / PermanentDaylightSavingTime
Schema start 3 First valid time for the schema event. The event will not fire before this moment. A valid timestamp string, e.g. 2022-10-19T10:19:30.000
Schema expiration 3 Last valid time for the schema event. The event will not fire after this moment. A valid timestamp string or 9999-01-01T00:00:00.000 to signify “never”
Schema filter description 3 Used to control when a schema event is allower to trigger. More info here. Default: “* _ - _ * * *”
Schema time zone 3 Time zone the schema event is evaluated in E.g. “Europe/Paris”
Time contstraint seconds 4 Used for composite events. Defines a window in which all dependent tasks have to complete. Integer >= 0
Time contstraint minutes 4 Used for composite events. Defines a window in which all dependent tasks have to complete. Integer >= 0
Time contstraint hours 4 Used for composite events. Defines a window in which all dependent tasks have to complete. Integer >= 0
Time contstraint days 4 Used for composite events. Defines a window in which all dependent tasks have to complete. Integer >= 0
Rule counter 4 Counter identifying rules that define upstream task executions the current task is depending on. Integer > 0
Rule state 4 Is the rule waiting for success or failure of upstream task? TaskSuccessful / TaskFail
Rule task name Name of the rule Any string
Rule task id 4 Reference to the upstream task. Any string (if referring to a task within the same file), or a valid id of a task that already exists in Sense.
Two options exist: If the “Rule task id” has the same value as the “Task id” of another task in the source file, those two tasks will be linked via this rule. If the “Rule task id” refers to an existing task id in Sense, the new rule will link to that existing task.

Meaning of “Comment” column above:

1: These columns are required for all lines where top-level task information is defined.
2: These columns are required for all lines where general event info (shared for schema and composite events) is defined. There may be zero or more such lines for a specific task.
3: These columns are required for all lines where schema events info are defined.
4: These columns are required for all lines where composite events (“task chains”) are defined.

Source file columns for app import definitions

If apps should be imported (by means of the --import-app option) an Excel file must be provided with info about what app QVF files should be imported, as well as details about each app import.
A sheet name (where the app details are found) in the Excel file must also be specified using the --import-app-sheet-name option.

The columns (case sensitive!) in the app import definition file are:

Column name Description Valid values
App counter Counter starting at 1. Increments one step for each app. Integer > 0
App name Name of the app that will be created based on the specified QVF file. Any string. Emojis allowed.
QVF directory Directory where app QVF files are stored Any valid path, absolute or relative.
QVF name Name of QVD file, including extension. Any valid file name.
Exclude data connections Should data connections stored in the QVF file be excluded during app import or not. true / false
App tags Tags to set on the imported app. Format is “tag1 / tag2 / tag with spaces in it”, i.e. separate tag names by “space-forward slash-space”.
App custom properties Custom properties to set on the imported app. Format is “CustPropName1=Value1 / CustPropName2=Value2”
Owner user directory If app owner should be set for this app, specify the user directory name here. Both user directory and user id must be correctly defined for the app owner to be updated. Any user directory currently defined in the QMC, or Internal for Sense internal accounts.
Owner user id If app owner should be set for this app, specify the user id here. Both user directory and user id must be correctly defined for the app owner to be updated. Any user ID defined in the user directory defined in Owner user directory column (above).
Publish to stream If this app should be published, specify stream id or name here. If the id is not associated with a stream or the specified stream name does not exist the app will not be published Any existing stream name or id associated with an existing stream.
Publish options
(optional)
Specify publish options here, for example if an already published app with the same name should be overwritten or not.
The default behaviour is publish-replace, which will be used when no “Publish options” column is present in the Excel sheet or that column exists but is empty.
publish-replace: If there already exists a published app with the same name in the specified stream, replace that app with the new one.
publish-another: If there already exists a published app with the same name in the specified stream, publish tnother one.
delete-publish: First delete an already existing app (if there is one), then publish the new app.

The publish options are described in more detail here.

Example: Export tasks to CSV, then import tasks from same CSV

This example will

  1. Export ca 50 tasks to a CSV file
  2. Import tasks from the just created CSV file

The CSV file created during the task export will contain some columns that are not needed during task import (last execution timestamp for each task and similar).
That’s fine though, during the task import Ctrl-Q will only look at the required columns and simply disregard all other columns.

Export tasks to CSV file:

.\ctrl-q.exe qseow task-get `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --output-format table `
  --output-dest file `
  --output-file-name tasks.csv `
  --output-file-format csv
2024-11-15T17:01:55.650Z info: -----------------------------------------------------------
2024-11-15T17:01:55.653Z info: | Ctrl-Q
2024-11-15T17:01:55.653Z info: |
2024-11-15T17:01:55.653Z info: | Version      : 4.0.0
2024-11-15T17:01:55.653Z info: | Log level    : info
2024-11-15T17:01:55.653Z info: |
2024-11-15T17:01:55.653Z info: | Command      : task-get
2024-11-15T17:01:55.653Z info: |              : get info about one or more tasks
2024-11-15T17:01:55.655Z info: |
2024-11-15T17:01:55.655Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T17:01:55.656Z info: |
2024-11-15T17:01:55.656Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T17:01:55.656Z info: ----------------------------------------------------------
2024-11-15T17:01:55.656Z info:
2024-11-15T17:01:56.048Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T17:01:59.710Z info: ✅ Writing task table to disk file "tasks.csv".

Now let’s import tasks from the tasks.csv file:

.\ctrl-q.exe qseow task-import `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-cert-file ./cert/client.pem `
  --auth-cert-key-file ./cert/client_key.pem `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --file-type csv `
  --file-name tasks.csv

It’s worth noting that all the created tasks will be linked into the task chains that existed when the tasks where first exported into the CSV file.
This happens because the composite event rules that were exported into the CSV file (i.e. “start the task when task A and task B have successfully finished reloaded”) contain task IDs that point to already existing reload tasks in Sense.
When that’s the case the newly created tasks (based on the info in the CSV file) will link to those existing tasks.

This way a newly created task (based on info in the CSV file) can still be configured to start after some already existing task finish reloading.

Note how Ctrl-Q first creates the reload tasks and any associated schedule triggers in a first step, then add any composite triggers in the second step.
This is needed as a composite trigger may refer to an already existing and/or a newly created task (or multiple tasks of course), i.e. all tasks must first be created. Only then is it possible to create composite triggers.

2024-11-15T17:02:27.877Z info: -----------------------------------------------------------
2024-11-15T17:02:27.881Z info: | Ctrl-Q
2024-11-15T17:02:27.881Z info: |
2024-11-15T17:02:27.882Z info: | Version      : 4.0.0
2024-11-15T17:02:27.882Z info: | Log level    : info
2024-11-15T17:02:27.883Z info: |
2024-11-15T17:02:27.883Z info: | Command      : task-import
2024-11-15T17:02:27.883Z info: |              : create tasks based on definitions in a file on disk, optionally also importing apps from QVF files.
2024-11-15T17:02:27.883Z info: |
2024-11-15T17:02:27.885Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T17:02:27.885Z info: |
2024-11-15T17:02:27.885Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T17:02:27.885Z info: ----------------------------------------------------------
2024-11-15T17:02:27.885Z info:
2024-11-15T17:02:27.889Z info: Import tasks from definitions in file "tasks.csv"
2024-11-15T17:02:28.247Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T17:02:28.403Z info: Successfully retrieved 36 custom properties from QSEoW
2024-11-15T17:02:28.478Z info: -------------------------------------------------------------------
2024-11-15T17:02:28.478Z info: Creating tasks...
2024-11-15T17:02:28.805Z info: (1) Created new external program task "App snapshots end of September 2022", new task id: c433730d-031b-4ad6-a3fa-efb20df6c294.
2024-11-15T17:02:28.984Z info: (2) Created new external program task "Ext program task chaining 1", new task id: 41c99884-85da-45d8-8cdb-3cfa868d9591.
2024-11-15T17:02:29.167Z info: (3) Created new external program task "Ext program task chaining 1", new task id: 4743c805-db3e-47f1-afef-9689c6b4e086.
2024-11-15T17:02:29.331Z info: (4) Created new external program task "Ext program task chaining 1", new task id: 301a83e5-c7bb-4c6e-9dd4-970ceeeb7848.
2024-11-15T17:02:29.542Z info: (5) Created new external program task "Ext task 1", new task id: 31558ba5-cfca-424b-9161-0ac805e5c114.
2024-11-15T17:02:29.721Z info: (6) Created new external program task "Ext task 2", new task id: 73dbe993-4645-4143-9b60-721a10f229f0.
2024-11-15T17:02:29.889Z info: (7) Created new external program task "New external program task 1", new task id: 991e53fd-7179-4b88-b76a-58ef28b165ec.
2024-11-15T17:02:30.060Z info: (8) Created new external program task "New external program task 1", new task id: 2e6c35eb-06db-4aef-ad08-dfbd8e14e3ff.
2024-11-15T17:02:30.231Z info: (9) Created new external program task "Node-RED ext program task demo 1", new task id: 41fe623f-2cb9-4a1e-b1aa-5235c5970f82.
2024-11-15T17:02:30.403Z info: (10) Created new external program task "PowerShell export data connections", new task id: 3f9f2738-5e00-41b9-ad3b-872b3b98f47e.
2024-11-15T17:02:30.574Z info: (11) Created new external program task "PowerShell export tags (ext pgm task)", new task id: 845ae177-fae9-4908-91a7-8270c752a7a8.
2024-11-15T17:02:30.738Z info: (12) Created new external program task "Sample external task", new task id: 782a0202-8a84-4ce3-9c02-ad5a9ebec013.
2024-11-15T17:02:31.638Z info: (13) Created new external program task "[ctrl-q task chain 3] Ext program task chaining", new task id: 56c5900d-60b4-45b9-b0a9-8628b3689008.
2024-11-15T17:02:31.805Z info: (14) Created new external program task "[ctrl-q task chain 3] Ext program task chaining", new task id: 951178cd-c96c-4a64-80e4-058dc49079f4.
2024-11-15T17:02:32.291Z info: (15) Created new external program task "[ctrl-q task chain 4] Ext program task chaining", new task id: 7e58312c-dbd6-499c-8ff4-6720a8e0e667.
2024-11-15T17:02:32.511Z info: (16) Created new external program task "[ctrl-q task chain 4] Ext program task chaining", new task id: a70fbc1d-c257-450d-a7c9-c44b2bf59dbd.
2024-11-15T17:02:32.983Z info: (17) Created new reload task "Butler test failing reloads 1 task", new task id: 38196f68-f1f3-4b19-8e12-ce2ccf20f481.
2024-11-15T17:02:33.367Z info: (18) Created new reload task "Butler test failing reloads 1 task", new task id: 5993e407-4497-4b8d-a2ad-5767b5635bd5.
2024-11-15T17:02:33.793Z info: (19) Created new reload task "Manually triggered reload of Always failing reload (no delay)", new task id: 2109d58b-2e09-4299-8b9d-09a23bde755a.
2024-11-15T17:02:34.160Z info: (20) Created new reload task "Manually triggered reload of Butler 7 Slack debug", new task id: 2a5845d7-edd7-4214-90c9-a478aafae9ca.
2024-11-15T17:02:34.520Z info: (21) Created new reload task "Manually triggered reload of Butler regression test app 1", new task id: 9d450ba3-1d8b-4bd5-ba76-2c510003eb70.
...
...
2024-03-12T09:34:38.450Z info: -------------------------------------------------------------------
2024-03-12T09:34:38.450Z info: Creating composite events for the just created tasks...
2024-11-15T17:03:27.785Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="When [ctrl-q 2] done" for task ID 56c5900d-60b4-45b9-b0a9-8628b3689008. Result: 201/Created.
2024-11-15T17:03:28.188Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="Start ext pgm task when reload task done" for task ID 56c5900d-60b4-45b9-b0a9-8628b3689008. Result: 201/Created.
2024-11-15T17:03:28.568Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="When [ctrl-q task chain 3] done" for task ID 7e58312c-dbd6-499c-8ff4-6720a8e0e667. Result: 201/Created.
2024-11-15T17:03:29.018Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="When HR metrics done" for task ID 6158da08-c1e3-4e90-a780-0fd871975913. Result: 201/Created.
2024-11-15T17:03:29.376Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="When Operations monitor has reloaded" for task ID e43f5a5d-3e46-492a-85c0-851e863ebf9d. Result: 201/Created.
2024-11-15T17:03:29.781Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="When NYT comments done" for task ID 56132d4c-5358-40a2-9f7d-3d1c87f53679. Result: 201/Created.
...
...

Example: Import apps from QVF files and create associated reload tasks

This example will

  1. Import 3 apps from QVF files. Definitions of which files to import are stored in an Excel file.
    1. Tags and custom properties will be set for the apps.
    2. New app owners will be set.
    3. The apps will be published to streams.
  2. Create reload tasks based on definitions in same Excel file (but on a different sheet).
  3. The reload tasks will be associated with the previously imported apps.
  4. The reload tasks will be linked in a task chain.
  5. Some imported tasks will be triggered by already existing Sense tasks while others will be triggered by newly created tasks.
  6. There will be a 2 second delay after each QVF file has finished uploading, to reduce load on the Sense server.

The task import command looks like this in PowerShell:

.\ctrl-q.exe qseow task-import `
  --auth-type cert `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --auth-cert-file ./cert/client.pem `
  --auth-cert-key-file ./cert/client_key.pem `
  --auth-user-dir LAB `
  --auth-user-id goran `
  --file-type excel `
  --file-name tasks.xlsx `
  --sheet-name "Ctrl-Q task import 1" `
  --import-app `
  --import-app-sheet-name "App import" `
  --sleep-app-upload 2000
2024-11-15T17:05:18.127Z info: -----------------------------------------------------------
2024-11-15T17:05:18.130Z info: | Ctrl-Q
2024-11-15T17:05:18.130Z info: |
2024-11-15T17:05:18.130Z info: | Version      : 4.0.0
2024-11-15T17:05:18.132Z info: | Log level    : info
2024-11-15T17:05:18.132Z info: |
2024-11-15T17:05:18.133Z info: | Command      : task-import
2024-11-15T17:05:18.133Z info: |              : create tasks based on definitions in a file on disk, optionally also importing apps from QVF files.
2024-11-15T17:05:18.133Z info: |
2024-11-15T17:05:18.134Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T17:05:18.134Z info: |
2024-11-15T17:05:18.134Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T17:05:18.134Z info: ----------------------------------------------------------
2024-11-15T17:05:18.134Z info:
2024-11-15T17:05:18.137Z info: Import tasks from definitions in file "tasks.xlsx"
2024-11-15T17:05:18.517Z info: Successfully retrieved 29 tags from QSEoW
2024-11-15T17:05:18.666Z info: Successfully retrieved 36 custom properties from QSEoW
2024-11-15T17:05:18.701Z info: -------------------------------------------------------------------
2024-11-15T17:05:18.701Z info: Importing apps...
2024-11-15T17:05:18.701Z info: (1) Importing app "App 3" from file "C:/tools/ctrl-q/testdata/App import 3.qvf"
2024-11-15T17:05:25.076Z info: (1, delete-publish) App "App 3" published to stream "Ctrl-Q demo apps", the existing app (if one exists) with the same name in this stream has been deleted. Id of published app: 0de10164-c255-4b8f-bb8f-4458fa43623a
2024-11-15T17:05:25.078Z info: (2) Importing app "App 3" from file "C:/tools/ctrl-q/testdata/App import 3.qvf"
2024-11-15T17:05:34.034Z info: (2, publish-replace) App "App 3" published to stream "Ctrl-Q demo apps", replacing the existing app with the same name. Id of published app: 0de10164-c255-4b8f-bb8f-4458fa43623a
2024-11-15T17:05:34.034Z info: (3) Importing app "App 1" from file "C:/tools/ctrl-q/testdata/App import 1.qvf"
2024-11-15T17:05:40.133Z warn: (3) PUBLISH APP publish-replace: More than one app with the same name "App 1" in the target stream "Ctrl-Q demo apps". Impossible to know which one to replace. Skipping publishing for this app. The uploaded app is still present in the QMC (id=859b42dc-ea4f-4ae9-b61b-1d67341308c4).
2024-11-15T17:05:40.133Z error: (3) Failed publishing app "App 1" to stream "Ctrl-Q demo apps"
2024-11-15T17:05:40.133Z info: (4) Importing app "App 1" from file "C:/tools/ctrl-q/testdata/App import 1.qvf"
2024-11-15T17:05:45.507Z info: (4, publish-another) App "App 1" published to stream "Ctrl-Q demo apps". Id of published app: ddd17a51-86c8-489b-b13c-194e9a61dc53
2024-11-15T17:05:45.508Z info: (5) Importing app "App 1" from file "C:/tools/ctrl-q/testdata/App import 1.qvf"
2024-11-15T17:05:50.770Z warn: (5) PUBLISH APP publish-replace: More than one app with the same name "App 1" in the target stream "Ctrl-Q demo apps". Impossible to know which one to replace. Skipping publishing for this app. The uploaded app is still present in the QMC (id=b676ea6d-fd75-4fdf-a3b7-2f318a043876).
2024-11-15T17:05:50.770Z error: (5) Failed publishing app "App 1" to stream "Ctrl-Q demo apps"
2024-11-15T17:05:50.771Z info: (6) Importing app "App 2" from file "C:/tools/ctrl-q/testdata/App import 2.qvf"
2024-11-15T17:05:55.354Z warn: Stream "Stream does not exist" does not exist.
2024-11-15T17:05:55.354Z error: (6) Failed publishing app "App 2" to stream "Stream does not exist". The uploaded app is still present in the QMC (id=5fb8db40-f4b2-49fe-8d72-acd12d8c82bd).
2024-11-15T17:05:55.354Z info: (7) Importing app "App 3" from file "C:/tools/ctrl-q/testdata/App import 3.qvf"
2024-11-15T17:06:02.763Z info: (7, publish-replace) App "App 3" published to stream "Ctrl-Q demo apps", replacing the existing app with the same name. Id of published app: 0de10164-c255-4b8f-bb8f-4458fa43623a
2024-11-15T17:06:02.765Z info: -------------------------------------------------------------------
2024-11-15T17:06:02.765Z info: Creating tasks...
2024-11-15T17:06:03.175Z info: (1) Created new reload task "Reload task of App 1", new task id: 21c439b1-23a5-48e5-a63e-c95da4e7ede9.
2024-11-15T17:06:03.570Z info: (2) Created new reload task "Manually triggered reload of Always failing reload (no delay)", new task id: 9d6b758a-9954-4430-9d3e-d0ab41ee3db3.
2024-11-15T17:06:03.962Z info: (3) Created new reload task "Manually triggered reload of App1 🏆", new task id: 25ecd53b-ffcf-4131-89ef-2e5a105312a3.
2024-11-15T17:06:04.310Z info: (4) Created new reload task "Manually triggered reload of Butler 7 Slack debug", new task id: 569cbcb8-631c-4ee5-9c50-939755a6668c.
2024-11-15T17:06:05.323Z info: (5) Created new reload task "Reload task of Lab 1_1", new task id: 4677a482-b527-4fe8-a3d4-dd22dfb03d98.
2024-11-15T17:06:05.323Z info: -------------------------------------------------------------------
2024-11-15T17:06:05.324Z info: Creating composite events for the just created tasks...
2024-11-15T17:06:05.535Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="Trigger when upstream tasks are done" for task ID 4677a482-b527-4fe8-a3d4-dd22dfb03d98. Result: 201/Created.

Some comments about the above command:

  • The certificates used to authenticate with Sense are stored in the cert subdirectory, right under where Ctrl-Q is started from.
    That’s the default locataion, meaning that the options --auth-cert-file and --auth-cert-key-file are really not needed in this example.
  • The app and task definitions are found in a Excel file (--file-type option) named tasks.xlsx.
  • Task definitions are found in the Excel file’s sheet named Ctrl-Q task import.
  • The --import-app tells Ctrl-Q to import certain apps before tasks defined in the Ctrl-Q task import 1 sheet are created. This parameter is optional. If it is not included no apps will be imported.
  • The --import-app-sheet-name tells Ctrl-Q that a list of apps to be imported (and import parameters for each app) is found the App import sheet of the Excel file.

NOTE 1: A sample defintions Excel file is available in the GitHub repository. NOTE 2: The structure of the Excel sheet specified by the --import-app-sheet-name is described above.

Defining tasks to be created

The format is the same as when importing tasks only (and no apps).
More info here.

Associating new tasks with imported and existing apps

A few special cases apply when tasks are created and apps also imported.

In this situation it’s important that tasks can be associated with either the newly imported apps or already existing apps.
Similarly, for composite task triggers (used to create task chains) it’s important that either newly created tasks or already existing tasks can be referenced.

Let’s say the following three QVF files should be imported into Sense.
Note the App counter column, with values 1, 2 and 3.

QVF app files that should be imported into Qlik Sense

Now let’s look at the tasks to be created. In the image below the main info (task name etc) for each of the four tasks is shown.
Note that the Task id column has both proper GUIDs and simple integers in it.
This will be important when defining composite triggers.

Reload tasks should be created in Qlik Sense

Finally let’s look at the composite triggers associated with the last of the four tasks.
That composite trigger relies on two tasks, one that should fail (TaskFail) to trigger the composite trigger and one that should succeed (TaskSuccessful).

The important part here is the last column, Rule task id:

  • If that column contains a valid GUID it is assumed to be a reference to an existing task.
  • If the column contains an integer it is assumed to be a reference to a newly created task.
    Which task? The one with the same integer number in the Task id column (see previous paragraph).

This way it’s possible to chain new reload tasks to both already existing tasks and new ones.

Reload tasks should be created in Qlik Sense

1.13 - User activity buckets

User activity buckets are custom properties that indicate how long ago users last logged into Qlik Sense.

Page contents:


Overview

User activity buckets are custom properties that indicate how long ago users last logged into Qlik Sense. The qseow user-activity-bucket-cp-create command creates a custom property if it doesn’t already exists and populates it with values (“activity buckets”) indicating how long ago users last logged into Sense.

There are several options available to customize the behavior of the command, such as the name of the custom property, the activity buckets to be defined, the user directories whose users will be updated with activity info, and the license types to consider when calculating user activity.

The command can be run in dry-run mode to see what would be done without actually creating or updating anything.

The command has default values for most options, making it easy to run without specifying any options. The default values can be overridden by specifying the desired values as command line options.

The different steps of the command

  • Step 1: Create custom property for tracking user activity in QMC
    • Retrieve all custom properties from QSEoW.
    • Create the custom property if it doesn’t already exist.
    • The --force option can be used to forcibly overwrite and replace the custom property and its values if the custom property already exists. Only needed if the custom property already exists and has choice values that differ from the ones passed in via the command line.
  • Step 2: Getting user activity for each license type enabled via the command line
    • Retrieve user activity records for each license type enabled via the command line.
    • The command supports the following license types: analyzer, analyzer-time, login, professional, user
  • Step 3: Calculate days since last activity for each user
  • Step 4: Get user data from Sense, one batch at a time
    • Batching is done to avoid overloading the Sense repository API.
    • The --update-batch-size option can be used to specify batch size. Valid values are 1-25.
    • The --update-batch-sleep option can be used to specify how long to wait before continuing after each batch of users has been updated in Sense. 0 = no wait.
  • Step 5: Update user activity custom property in Qlik Sense
    • Write activity data for each user back into Sense.
    • The command will update the custom property in batches of 25 users (default batch size).
    • The --update-user-sleep option can be used to specify how long to wait after updating each user in the Qlik Sense repository, i.e. within the batch. 0 = no wait.

Note that step 5 may take a while to complete on a large system with many users.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow user-activity-bucket-cp-create --help
Usage: ctrl-q qseow user-activity-bucket-cp-create [options]

create custom property and populate it with values ("activity buckets") indicating how long ago users last logged into Sense

Options:
  --log-level <level>                    log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                          Qlik Sense server IP/FQDN
  --port <port>                          Qlik Sense repository API port (default: "4242")
  --virtual-proxy <prefix>               Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>                  https connection to Qlik Sense must use correct certificate. Invalid certificates will result in rejected/failed connection. (default: true)
  --auth-user-dir <directory>            user directory for user to connect with (default: "Internal")
  --auth-user-id <userid>                user ID for user to connect with (default: "sa_repository")
  -a, --auth-type <type>                 authentication type (choices: "cert", "jwt", default: "cert")
  --auth-cert-file <file>                Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>            Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>           Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --jwt <JWT>                            JSON Web Token (JWT) to use for authenticating with Qlik Sense (default: "")
  --user-directory <name...>             name of user directories whose users will be updated with activity info (default: "")
  --license-type <name...>               license type(s) to consider when calculating user activity. Default is all license types. (choices: "analyzer", "analyzer-time", "login", "professional", "user", default:
                                         ["analyzer","analyzer-time","login","professional","user"])
  --custom-property-name <name>          name of custom property that will hold user activity buckets
  --force                                forcibly overwrite and replace custom property and its values if the custom property already exists
  --activity-buckets <buckets...>        custom property values/user activity buckets to be defined. A comma or space separated list of numbers, representing days since last login. (default:
                                         ["1","7","14","30","90","180","365"])
  --update-batch-size <number of users>  number of users to update in each batch when writing user activity info back into Sense. Valid values are 1-25. (default: 25)
  --update-batch-sleep <seconds>         Wait this long before continuing after each batch of users has been updated in Sense. 0 = no wait. (default: 3)
  --update-user-sleep <milliseconds>     Wait this long after updating each user in the Qlik Sense repository. 0 = no wait. (default: 500)
  --dry-run                              do a dry run, i.e. do not create or update anything - just show what would be done
  -h, --help                             display help for command

Example

In this example the largest bucket is set to 14 days, meaning that users who have logged in more than 14 days ago will be placed in a bucket called 14+.

The command will create a custom property named User_Activity_Bucket and populate it with values indicating how long ago users last logged into Sense.

The --force option is used to forcibly overwrite and replace the custom property and its values if the custom property already exists. This is only needed if the custom property already exists and has choice values that differ from the ones passed in via the command line.

.\ctrl-q.exe qseow user-activity-bucket-cp-create `
  --host pro2-win1.lab.ptarmiganlabs.net `
  --custom-property-name User_Activity_Bucket `
  --activity-buckets 1 7 14 `
  --force
2024-11-19T06:11:52.344Z info: -----------------------------------------------------------
2024-11-19T06:11:52.344Z info: | Ctrl-Q
2024-11-19T06:11:52.344Z info: |
2024-11-19T06:11:52.344Z info: | Version      : 4.1.0
2024-11-19T06:11:52.344Z info: | Log level    : info
2024-11-19T06:11:52.344Z info: |
2024-11-19T06:11:52.344Z info: | Command      : user-activity-bucket-cp-create
2024-11-19T06:11:52.344Z info: |              : create custom property and populate it with values ("activity buckets") indicating how long ago users last logged into Sense
2024-11-19T06:11:52.344Z info: |
2024-11-19T06:11:52.344Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T06:11:52.344Z info: |
2024-11-19T06:11:52.344Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T06:11:52.344Z info: ----------------------------------------------------------
2024-11-19T06:11:52.344Z info:
2024-11-19T06:11:52.359Z info: == Step 1: Create custom property for tracking user activity in QMC
2024-11-19T06:11:52.719Z info:   Successfully retrieved 38 custom properties from QSEoW
2024-11-19T06:11:54.032Z info: Successfully updated custom property "User_Activity_Bucket"
2024-11-19T06:11:54.188Z info:
2024-11-19T06:11:54.188Z info: == Step 2 : Getting user activity for each license type enabled via the command line...
2024-11-19T06:11:54.344Z info:   Successfully retrieved 20 user activity records for license type "Analyzer" from QSEoW
2024-11-19T06:11:54.485Z info:   Successfully retrieved 0 user activity records for license type "Analyzer Time" from QSEoW
2024-11-19T06:11:54.641Z info:   Successfully retrieved 0 user activity records for license type "Login" from QSEoW
2024-11-19T06:11:54.797Z info:   Successfully retrieved 20 user activity records for license type "Professional" from QSEoW
2024-11-19T06:11:54.969Z info:   Successfully retrieved 0 user activity records for license type "User" from QSEoW
2024-11-19T06:11:54.969Z info:
2024-11-19T06:11:54.969Z info: == Step 3 : Calculate days since last activity for each user...
2024-11-19T06:11:54.969Z info:
2024-11-19T06:11:54.969Z info: == Step 4 : Get user data from Sense, one batch at a time (each batch is 25 users)...
2024-11-19T06:11:54.969Z info:   Total number of users to process: 40
2024-11-19T06:11:54.969Z info:   Total number of batches: 2
2024-11-19T06:11:54.969Z info:
2024-11-19T06:11:54.969Z info:   >> Batch 1 of 2 (users 1 to 25)
2024-11-19T06:11:54.969Z info:      Calculating activity buckets
2024-11-19T06:11:55.266Z info:      Preparing user activity custom property
2024-11-19T06:11:55.266Z info:      Pausing 3 seconds before next batch...
2024-11-19T06:11:58.292Z info:
2024-11-19T06:11:58.292Z info:   >> Batch 2 of 2 (users 26 to 50)
2024-11-19T06:11:58.292Z info:      Calculating activity buckets
2024-11-19T06:11:58.558Z info:      Preparing user activity custom property
2024-11-19T06:11:58.558Z info:      Pausing 3 seconds before next batch...
2024-11-19T06:12:01.584Z info:
2024-11-19T06:12:01.584Z info: Done calculating activity buckets for all users. Proceeding to update user activity custom property in Qlik Sense.
2024-11-19T06:12:01.584Z info:
2024-11-19T06:12:01.584Z info: == Step 5 : Update user activity custom property in Qlik Sense.
2024-11-19T06:12:01.584Z info:   Number of batches to process: 2 of 25 users each.
2024-11-19T06:12:01.584Z info:   Storing activity buckets for batch 1 of 2 in Sense repository.
2024-11-19T06:12:01.896Z info:     Updated user 1 of 40, "LAB\testuser_40" in batch 1 of 2
2024-11-19T06:12:03.334Z info:     Updated user 2 of 40, "LAB\testuser_34" in batch 1 of 2
2024-11-19T06:12:04.147Z info:     Updated user 3 of 40, "LAB\testuser_25" in batch 1 of 2
2024-11-19T06:12:04.943Z info:     Updated user 4 of 40, "LAB\testuser_38" in batch 1 of 2
2024-11-19T06:12:05.772Z info:     Updated user 5 of 40, "LAB\testuser_29" in batch 1 of 2
2024-11-19T06:12:06.569Z info:     Updated user 6 of 40, "LAB\testuser_30" in batch 1 of 2
2024-11-19T06:12:07.443Z info:     Updated user 7 of 40, "LAB\testuser_24" in batch 1 of 2
2024-11-19T06:12:08.241Z info:     Updated user 8 of 40, "LAB\testuser_31" in batch 1 of 2
2024-11-19T06:12:09.053Z info:     Updated user 9 of 40, "LAB\testuser_32" in batch 1 of 2
2024-11-19T06:12:09.943Z info:     Updated user 10 of 40, "LAB\testuser_8" in batch 1 of 2
2024-11-19T06:12:10.819Z info:     Updated user 11 of 40, "LAB\testuser_17" in batch 1 of 2
2024-11-19T06:12:11.787Z info:     Updated user 12 of 40, "LAB\testuser_10" in batch 1 of 2
2024-11-19T06:12:12.740Z info:     Updated user 13 of 40, "LAB\testuser_7" in batch 1 of 2
2024-11-19T06:12:13.865Z info:     Updated user 14 of 40, "LAB\testuser_19" in batch 1 of 2
2024-11-19T06:12:14.803Z info:     Updated user 15 of 40, "LAB\testuser_28" in batch 1 of 2
2024-11-19T06:12:15.771Z info:     Updated user 16 of 40, "LAB\testuser_23" in batch 1 of 2
2024-11-19T06:12:16.715Z info:     Updated user 17 of 40, "LAB\testuser_33" in batch 1 of 2
2024-11-19T06:12:17.663Z info:     Updated user 18 of 40, "LAB\testuser_37" in batch 1 of 2
2024-11-19T06:12:18.665Z info:     Updated user 19 of 40, "LAB\testuser_21" in batch 1 of 2
2024-11-19T06:12:19.665Z info:     Updated user 20 of 40, "LAB\testuser_39" in batch 1 of 2
2024-11-19T06:12:20.664Z info:     Updated user 21 of 40, "LAB\testuser_35" in batch 1 of 2
2024-11-19T06:12:21.765Z info:     Updated user 22 of 40, "LAB\testuser_36" in batch 1 of 2
2024-11-19T06:12:22.757Z info:     Updated user 23 of 40, "LAB\testuser_22" in batch 1 of 2
2024-11-19T06:12:23.710Z info:     Updated user 24 of 40, "LAB\testuser_26" in batch 1 of 2
2024-11-19T06:12:24.641Z info:     Updated user 25 of 40, "LAB\testuser_27" in batch 1 of 2
2024-11-19T06:12:25.158Z info:   Storing activity buckets for batch 2 of 2 in Sense repository.
2024-11-19T06:12:25.610Z info:     Updated user 26 of 40, "LAB\testuser_11" in batch 2 of 2
2024-11-19T06:12:26.516Z info:     Updated user 27 of 40, "LAB\testuser_2" in batch 2 of 2
2024-11-19T06:12:27.532Z info:     Updated user 28 of 40, "LAB\testuser_20" in batch 2 of 2
2024-11-19T06:12:28.815Z info:     Updated user 29 of 40, "LAB\goran" in batch 2 of 2
2024-11-19T06:12:29.938Z info:     Updated user 30 of 40, "LAB\testuser_12" in batch 2 of 2
2024-11-19T06:12:31.032Z info:     Updated user 31 of 40, "LAB\testuser_1" in batch 2 of 2
2024-11-19T06:12:32.115Z info:     Updated user 32 of 40, "LAB\testuser_4" in batch 2 of 2
2024-11-19T06:12:33.079Z info:     Updated user 33 of 40, "LAB\testuser_15" in batch 2 of 2
2024-11-19T06:12:34.017Z info:     Updated user 34 of 40, "LAB\testuser_16" in batch 2 of 2
2024-11-19T06:12:35.063Z info:     Updated user 35 of 40, "LAB\testuser_3" in batch 2 of 2
2024-11-19T06:12:36.094Z info:     Updated user 36 of 40, "LAB\testuser_18" in batch 2 of 2
2024-11-19T06:12:37.236Z info:     Updated user 37 of 40, "LAB\testuser_9" in batch 2 of 2
2024-11-19T06:12:38.266Z info:     Updated user 38 of 40, "LAB\testuser_6" in batch 2 of 2
2024-11-19T06:12:39.267Z info:     Updated user 39 of 40, "LAB\testuser_14" in batch 2 of 2
2024-11-19T06:12:40.282Z info:     Updated user 40 of 40, "LAB\testuser_13" in batch 2 of 2
2024-11-19T06:12:40.798Z info:
2024-11-19T06:12:40.798Z info: Done updating user activity custom property in Qlik Sense.

In this screeshot from the QMC we can see the custom property User_Activity_Bucket for some users.
A couple of the users have been active during the last day, while have been inactive for more than 14 days.

User activity buckets in QMC

1.14 - Version

Shows current Ctrl-Q version

Page contents:


Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow version --help
Usage: ctrl-q qseow version [options]

show version info

Options:
  --log-level <level>  log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  -h, --help           display help for command

Example

.\ctrl-q.exe qseow version
2024-11-19T07:21:16.194Z info: -----------------------------------------------------------
2024-11-19T07:21:16.194Z info: | Ctrl-Q
2024-11-19T07:21:16.194Z info: |
2024-11-19T07:21:16.194Z info: | Version      : 4.1.0
2024-11-19T07:21:16.194Z info: | Log level    : info
2024-11-19T07:21:16.194Z info: |
2024-11-19T07:21:16.194Z info: | Command      : version
2024-11-19T07:21:16.194Z info: |              : show version info
2024-11-19T07:21:16.194Z info: |
2024-11-19T07:21:16.194Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-19T07:21:16.194Z info: |
2024-11-19T07:21:16.194Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-19T07:21:16.194Z info: ----------------------------------------------------------
2024-11-19T07:21:16.194Z info:
2024-11-19T07:21:16.194Z info: Version: 4.1.0

2 - Qlik Sense Cloud commands

Qlik Sense Cloud commands.

2.1 - Connection test

Command to test connection to Qlik Sense Cloud.

Page contents:


Test connection to Qlik Sense Cloud

Some of the Ctrl-Q commands are rather complex and it can be difficult to figure out what is wrong if the command fails.

To rule out any connection issues between the machine running Ctrl-Q and Qlik Sense Cloud it is possible to run the connection-test command.

Syntax

PS C:\tools\ctrl-q> .\ctrl-q.exe qscloud connection-test --help
Usage: ctrl-q qscloud connection-test [options]

test connection to Qlik Sense Cloud.

Options:
  --log-level <level>     log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --tenant-host <host>    Host of Qlik Sense cloud tenant. Example: "tenant.eu.qlikcloud.com"
  -a, --auth-type <type>  authentication type (choices: "apikey", default: "apikey")
  --apikey <key>          API key used to access the Sense APIs
  -h, --help              display help for command

Example

.\ctrl-q.exe qscloud connection-test `
  --tenant-host mytenant.eu.qlikcloud.com `
  --apikey "eyJhb..."
2024-11-15T17:37:26.948Z info: -----------------------------------------------------------
2024-11-15T17:37:26.952Z info: | Ctrl-Q
2024-11-15T17:37:26.952Z info: |
2024-11-15T17:37:26.952Z info: | Version      : 4.0.0
2024-11-15T17:37:26.952Z info: | Log level    : info
2024-11-15T17:37:26.953Z info: |
2024-11-15T17:37:26.953Z info: | Command      : connection-test
2024-11-15T17:37:26.953Z info: |              : test connection to Qlik Sense Cloud.
2024-11-15T17:37:26.953Z info: |
2024-11-15T17:37:26.954Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T17:37:26.954Z info: |
2024-11-15T17:37:26.954Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T17:37:26.954Z info: ----------------------------------------------------------
2024-11-15T17:37:26.954Z info:
2024-11-15T17:37:26.955Z info: Testing connection to Qlik Sense Cloud tenant "mytenant.eu.qlikcloud.com"
2024-11-15T17:37:27.826Z info: Successfully connected to Qlik Sense Cloud tenant "mytenant.eu.qlikcloud.com"
2024-11-15T17:37:27.826Z info: Tenant ID  : df.....
2024-11-15T17:37:27.828Z info: User ID    : 76456....
2024-11-15T17:37:27.828Z info: User name  : Göran Sander
2024-11-15T17:37:27.828Z info: User email : goran@ptarmiganlabs.com
2024-11-15T17:37:27.828Z info: User status: active