Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Is there anyway to capture NPrinting Audit Logs as details as possible?
Audit Logs require what the users clicks or change in :
1. User login into NP Web Console
2. User login to newsstand
3. NPrinting Designer
Thanks.
Hello all,
thanks for the info. Then it would make sense to wait for the February version.
But here I have the problem that I have never worked with the APIs, just do not know how they are written and how to use them.
Is there maybe a beginner course somewhere? 🙂
I am working now on the blog post which will cover exactly this - stay tuned. In a day or 2 you will have working example.
cheers
I just put something together here: https://nprintingadventures.com/2021/02/06/nprinting-audit-logs/
hope it helps
I'm trying to use your Nprinting.qvs script to pull audit data from Nprinting. It's working fine but there is that 1000 rows limit so I tried to download data in a loop. I noticed that in NPrinting_Audit_Data table, there is that totalItems field which seems to contain number of records in audit table. So I used that in my loop so pretty much it looks like this (trimmed it a little bit):
set vQueryOffset = 0;
Do
NPrinting_Audit_Data:
SQL SELECT
"totalItems",
"offset",
"limit",
"__KEY_data",
(SELECT
"id" AS "id_u1",
"userId",
"userName",
.
.
.
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH
CONNECTION( URL "$(vURL_Audit)", HTTPHEADER "cookie" "$(vCookie)", QUERY "Limit" "$(vQueryLimit)", QUERY "Offset" "$(vQueryOffset)", QUERY "dataType" "NewsstandReport");
;
let vTotalItems = peek('totalItems',-1,'NPrinting_Audit_Data');
let vQueryOffset = $(vQueryOffset)+$(vQueryLimit);
Loop until vQueryOffset >= vTotalItems
It works fine but I'm not getting all the records. For some reason I'm just getting records from yesterday (2021-05-25) and today (2021-05-26). And I know there are more because when I download log file using this URL: https://ServerName:4993/api/v1/audit/logs I can see records since 2021-05-21 (which is when I enabled audit in nprinting). What's wrong? How to build that CONNECTION string to get all records from db?
What's strange is when I add another parameter: QUERY "end" "2021-05-24T23:59:08Z" it gives me records from 2021-05-24 (still nothing from 2021-05-21 - 2021-05-23). I tried with "start" parameter and set it to 2021-05-01 but no change. Is there something like a default limit which returns just last 24h of data? Do I also need to add "start" and "end" parameters into my loop and fetch each day 1000 rows at a time and then go to next day?
I will try to build some extract to load that data incrementally and save into qvd but first I need to understand how that works...
@Ruggero_Piccoli maybe you will be able to help here as well?
Thanks!
Hi,
I think it is something related with the app you are using because Qlik NPrinting pages every 50 rows https://help.qlik.com/en-US/nprinting/May2021/APIs/NP+API/index.html?page=9 and the limit of the CSV is 2^20-1 = 1,048,575.
Best Regards,
Ruggero
Yeah, by default that limit is 50 but what @Lech_Miszkiewicz figured out is that we can increase that up to 1000 (above 1000 it gives an error) so I'm fetching 1000 records at one time, then increase offset by 1000. But it's worth a try to just read it in pages with 50 rows. I'll try that. Thx