Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

cancel
Showing results for 
Search instead for 
Did you mean: 
satyaban
Contributor III
Contributor III

How to get Nprinting Task Execution Logs using API

Dear All,

I am using NPrinting API to execute my task  but unable to get any end point for getting task execution logs 

API Link : https://help.qlik.com/en-US/nprinting/February2021/APIs/NP+API/index.html?page=50

But to Get Logs I didn't get any API and work around.

 

As an work around I tried to download log itself by task execution ID : let say URL of logs for a specific task execution is

https://qliknprinting.xyz.nett/npe/executions/e0de8e4a-3a8c-5fgt-bfe1-d9b46717eb25/logs/download

 

Code to download :

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Invoke-RestMethod -Uri "https://qliknprinting.xyz.nett/npe/executions/e0de8e4a-3a8c-5fgt-bfe1-d9b46717eb25/logs/download

But everytime I am getting same SSL Error 

Invoke-RestMethod : The request was aborted: Could not create SSL/TLS secure channel.

At E:\np_automation\np_task_execution\test.ps1:28 char:1


so basically I need solution to get logs for Nprinting task execution logs

Labels (2)
9 Replies
Frank_S
Support
Support

Hi @satyaban

 

Please confirm the version of NPrinting that you are using.

The label you used in this discussion is NPrinting 17.0 which is not supported and furthermore does not support NP APIs.

 

To allow execution of the NP API's you must be on a supported version of NPrinting server.

 

Kind regards...

We are just 'like' you and like to be liked when providing a helpful answer. You may also press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!
satyaban
Contributor III
Contributor III
Author

@Frank_S  yes I mentioned wrong version

Correct Version is 

Qlik NPrinting November 2020

Version: 20.39.3.0
Basically I am using NP API to execute tasks etc and its working fine

I am struggling to find task execution logs . I am fine with approach and technology but need some solution

 

Again to download logs  from URL itself throws SSL error as mentioned though I have set Security protocol

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Ruggero_Piccoli
Employee
Employee

Hi,

If you mean that you want to download the logs you see in the task executions page, there is not an API to do that.

You can use https://help.qlik.com/en-US/nprinting/November2020/APIs/NP+API/index.html?page=49 to get information and monitor the status of a specified execution of a task. During the execution you can run this get many times to be updated.

Starting from February 2021 there are APIs for Audit Events data https://help.qlik.com/en-US/nprinting/May2021/APIs/NP+API/index.html?page=9

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
satyaban
Contributor III
Contributor III
Author

I know downloading tasks logs from API  page not available .
basically I am looking for workaround to get that logs

 

Basically link to log is : https://nprinting.domain:4993/npe/executions/task_execution_id/logs/download

but here not able to authenticate using invoke-webrequest 

 

$User = "domain user"
$PWord = ConvertTo-SecureString -String "my password " -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
Invoke-RestMethod -Uri "https://nprinting.domain:4993/npe/executions/task_execution_id/logs/download" -Credential $Credential


but everytime getting authentication error 

as we are doing automation we need task execution logs to send in mail 
Ruggero_Piccoli
Employee
Employee

Hi,

You are trying to use a not documented, not officially supported method. So you do this at your own risk. If it works today it could also stop working in the future.

I strongly suggest you to use one of the officially supported methods.

You could also add this as a requested new feature https://community.qlik.com/t5/Labels-page/bd-p/Category_Labels?categoryId=qlik-ideas&corenode=boards....

Best Regards,

Ruggero 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
satyaban
Contributor III
Contributor III
Author

@Ruggero_Piccoli  yes thats true we should not follow unofficial approach .

But task execution logs afters execution of tasks is  pre-requisite for end user to check status .
Without logs there is no meaning of doing task execution automations 

This is very basic and minimum feature qlk should provide w.r.t NPrinting for large enterprise where automation is mandatory and priority  .

Thanks for your suggestion and guidance 

@Ruggero_Piccoli  one small query I have
Screenshot 2021-09-03 at 3.36.05 PM.png
as Download Logs button is available and can be downloaded from browser then somewhere in server it should be stored ....can we get that path sothat we can read that content

Ruggero_Piccoli
Employee
Employee

Hi,

If you run https://help.qlik.com/en-US/nprinting/November2020/APIs/NP+API/index.html?page=49 periodically you can retrieve the task execution status. It is included in the JSON answer.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
satyaban
Contributor III
Contributor III
Author

@Ruggero_Piccoli 
already I am able to track status of task execution for every 1 min interval for max 5 minutes 
Issue is incase it Failed to know reason log is mandatory .

Knowing status is not that much helpful without log

To check log again we have to login to server 

Frank_S
Support
Support

@satyaban

If the Public NP APIs do not fulfill your requirement,

I suggest inserting an in "Idea" here clearly documenting your requirement.

Kind regards...

 

We are just 'like' you and like to be liked when providing a helpful answer. You may also press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!