SAP Analytics Cloud administrators are typically faced with a task to download the activities log for auditing or compliance reasons. This, to date, has been a manual task which is somewhat problematic for a variety of reasons.
Whilst there has been an API to download these logs for a while, it’s not been possible to completely automate the task due to the lack of ‘OAuth client’ support. However, ‘OAuth client’ support is planned with new next release in Q1 2023.
It seemed to make sense, for me to create a sample script to download these logs, rather than for each customer to re-invent the thing over and over. So, that’s what I’ve done, and this sample solution is available now.
Remember, you’ll need to wait until the Q1 2023 release before you can use it. For those with a Test Preview, you’ll be able to use it sooner. (this assumes the feature does become available as planned)
My solution uses nodejs and Postman. If you’re happy to use nodejs (which is available on the SAP BTP platform too) and the Postman libraries ‘newman’ then this sample solution is ideal.
Command line interface
Files created
Design and error management
I’ve done my very best to remove as many barriers as I can, and it means you can immediately adopt and consume the Activities Log API
My meticulous attention to detail should mean you are probably going to avoid a number of rare errors and you may even resolve some exceptionally rare issues with the manual download too! I hadn’t realised how complicated downloading a bunch of logs really was until I dived into the detail and thought about it for weeks on end!
You’ll find an article below on this solution, but I’ve also added in a load of other related topics. I’ve compiled a list of best practices covering many areas including, the sample script itself, the activities log in general, a bunch of FAQs, and for the developer best practices when using the API.
Administrators just like you would very much value feedback from other customers on this solution. Please find the time to post a comment to this blog if you adopt it and hit the like button! As a suggestion, please use this template:
We have this number of activity logs: xx We use this sample with this number of SAP Analytics Cloud Services (tenants): xx We use the option(s): ‘all’, ‘lastfullmonth’, etc. We use time zone hour/mins: xx hours / 0 mins We use a scheduler to run this sample script: yes/no We saved this much time using this sample, rather than developing it ourselves: xx weeks/days We rate this sample out of 10 (1=low, 10=high): xx Our feedback for improvement is: xxYour feedback (and likes) will also help me determine if I should carry on investing my time to create such content.
Feel free to follow this blog for updates.
A simple demo of the command-line interface is shown here. There are 12 other command-line argument options available.
demo showing option ‘lastfullday’ (week and month periods also available)
4 main options, each option provides day, week and month variants
day
week
month
day
week
month
all
Easy to customise
Follow the detailed step-by-step user guide but at a high level:
Not all (older) logs may be downloadable via the API
2) Crash:
# # Fatal error in , line 0 # Fatal JavaScript invalid size error 169220804 # # # #FailureMessage Object: 0000007FDDBFC210 1: 00007FF77E779E7F node_api_throw_syntax_error+175967 2: 00007FF77E69036F v8::CTypeInfoBuildervoid::Build+11999 3: 00007FF77F4FD182 V8_Fatal+162 4: 00007FF77F03A265 v8::internal::FactoryBasev8::internal::Factory::NewFixedArray+101 5: 00007FF77EEDE7CE v8::Context::GetIsolate+16478 6: 00007FF77ED2AA40 v8::internal::CompilationCache::IsEnabledScriptAndEval+25952 7: 00007FF77F2378B1 v8::internal::SetupIsolateDelegate::SetupHeap+558193 8: 00007FF6FF4E6DA9Visit the user guide for more troubleshooting advice
A:
A:
A:
A:
A:
A:
A:
A:
A:
A:
A:
A:
A:
A:
A:
Overview
Request Parameters
Best Practice to avoid duplicate entries appearing on different pages