Capturing audit trail of Jasper Scheduled Reports or adhoc views that have been run
search cancel

Capturing audit trail of Jasper Scheduled Reports or adhoc views that have been run

book

Article ID: 144809

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

Is it possible to generate a report to provide an audit trail of all of the Jaspersoft "Scheduled Reports" and "Ad-hoc" views that have been run?

Additionally It would be desirable to see these fields in a report:

  • Report Name
  • Scheduled By/Owner
  • Notification for Report Sent to(To)
  • Report Copied to (CC)
  • Report Subject
  • Notification Sent to(To)
  • Notification Subject
  • Report Message
  • Send Report To
  • Send Report CC
  • Send Report BCC
  • Report Subject

Environment

Release : 16.1.2 and Jaspersoft 8.1.1

 

Resolution

There is no out-of-the-box report solution to this query. However details can be retrieved from Jaspersoft DB when Audit and Monitoring is enabled on Jaspersoft Reporting Server and using the available audit and monitoring events combination with the default audit reports. You would need to enable Audit and Monitoring on the Jaspersoft reporting server as a the first step.

References:

Enabling audit and monitoring in JRS

Video reference for enabling Auditing and Monitoring

Auditing and monitoring events

After audit and monitoring is enabled, you can leverage the audit and monitoring reports. Specifically the Audit report

-> Audit report only provides information about a report execution details, not how it is initiated. You can run the report located at "/public/audit/reports/Audit_Report" and apply the filters to get required information. You would need to query the quartz table to get the report job information and analyze it to get those scheduler related information.

Additional Information

  • How to identify the out-of-box/custom jasper reports which are run on ad-hoc basis?
    If Audit and monitoring is enabled.
    This query can get you when a report unit r achoc view was last used:

    SELECT * FROM jiauditevent WHERE resource_type IN ('ReportUnit','AdhocDataView') AND event_date > '2021-04-12 19:50:27.698' ORDER BY event_date ASC


  • How to identify 'created by' of custom jasper reports?
    There is no 'created by field' in the jiresource table.You do not need to login as someone to JSS to create a report, unlike JRS. JRS stores this info in access event table who did what and when, in JRS. You can run and check jiaccessevent table from your repository DB.  

    If auditing and monitoring is not enabled then the following query might help in finding how last modified the report. 
    SELECT r.name AS Report_Name, u.username AS Modified_User_Name, a.event_date FROM jiuser u
    INNER JOIN jiaccessevent a ON a.user_id = u.id
    INNER JOIN jiresource r ON r.id = a.resource_id AND r.name = 'Test_Report'
    ORDER BY 3 DESC
  • Please confirm which table in DB stores above information.
    {explained above} You could also combine the audit tables and make custom queries with the other tables such as jireportjob, jiresource, jiuser, qrtz, qrtz_triggers...