Customize the application to store audit logs

When you execute the ZIP Audit logs application, ZIP files that contain the audit logs are created for the month when the application was executed and the month prior, and they're stored in the storage of the workspace specified in the application.

This section describes the procedures for customizing the script for ZIP Audit logs to suit your needs.

This tutorial uses the ZIP Audit logs application. Before continuing this tutorial, install ZIP Audit logs from App Square.

For details about the installation of applications, refer to App Square.

Customization point

The following script is contained in the ZIP Audit logs application.

This section introduces the customization patterns.

Select the customizations you require from the below and follow the detailed procedures to change the script.

Procedures

Preparation

To customize the script of ZIP Audit logs, you must prepare the copy destination project in advance and then copy the script.

Copy the script using the following procedure:

  1. From the > APPLICATIONS page, select Detail of ZIP Audit logs.

  2. On the APPLICATIONS > ZIP Audit logs page, select View contained scripts from the action menu.

  3. On the APPLICATIONS > ZIP Audit logs > Scripts and resources page, select Copy to another project from the action menu in Contained scripts.

  4. In the Copy to another project dialog, set the fields as shown below.

    Field name

    Setting content (example)

    Script name

    ZIP_directories

    Copy to

    Specify a project.

  5. Select OK.

Customization1: Change the storage location workspace

In the script of ZIP Audit logs, the storage location workspace is specified by a script variable. You can change the storage location workspace by changing the script variable.

  1. From the > HULFT INTEGRATE > Projects page, open the project where you copied the script of ZIP Audit logs.

  2. From the project explorer, select the ZIP_directories script to open the script.

  3. From the project explorer, select Workspaces_Name.

  4. Change the Initial value of the New script variable dialog to the name of the workspace that you want to specify for the storage location.

  5. Save your changes.

Customization2: Create a scheduled job to save the logs of the previous month

Customize the script to save the logs of the previous month and execute it as a scheduled job.

(1) Customize the script

  1. From the > HULFT INTEGRATE > Projects page, open the project where you copied the script of ZIP Audit logs.

  2. From the project explorer, select the ZIP_directories script to open the script.

  3. Delete the operations that are marked in red for the script below.

    = Remarks =

    The operations that are marked in red perform the processing to create a ZIP file for the current month.

    Delete this processing, because it's not required in Customization2.

  4. Draw the flow.

    • When you choose not to change the storage location

      Draw the flow from the if end icon to the if end icon.

    • When you choose to change the storage location to match your environment

      Change the storage location by referring to Customization3.

  5. Save your changes.

(2) Create a scheduled job

Set a scheduled job to automatically execute on the first of every month at 7:00 PM.

  1. Select > JOBS > Schedule Jobs.

  2. On the Schedule Jobs page, select Add.

  3. In step General on the Schedule Jobs > Add New page, set the fields related to the scheduled job as shown below, and then select Next.

    Field name

    Setting content

    Name

    ZIP Audit Logs Job

    Workspace

    Audit_Logs

    Profile

    Choose a profile.

    Description

    (Optional)

  4. In step Recurrence, set the fields as shown below, and then select Next.

    Field name

    Setting content

    Recurrence

    Month

    Monthly occurrence

    Month Days

    Day of Month

    1

    last

    Don't select.

    Time

    19:00

    Start date

    Specify today's date.

    End date

    Specify a date.

    Time zone

    (UTC-08:00) Pacific Time (US & Canada)

  5. In step Holidays, set the fields as shown below, and then select Next.

    Field name

    Setting content

    Calendars

    Organization Calendar created in Prepare an organization calendar

    Holiday Option

    Execute on a holiday

  6. In step Project, set the fields as shown below, and then select Next.

    Field name

    Setting content

    Project

    Audit_Logs_Project

    Version

    Specify the latest version.

    Script

    ZIP_directories

    Script version

    Set the dependency relationship of scripts.

  7. In step Service to run scripts, specify the HULFT Integrate service of the script execution environment, and then select Next.

  8. In step Summary, confirm that the settings are correct, and then select Finish.

  9. Check whether the script is executed at the execution date and time of the scheduled job.

    Check the execution results of the script in > JOB EVENTS > Schedule Jobs.

Customization3: Save the created ZIP files to a specified location

You can save ZIP files of audit logs to a specified location according to your user environment by incorporating file upload operations for Box or AmazonS3, or by transferring files with HULFT Transfer.

When you combine Customization3 with Customization2, the flow is as follows:

The storage location of the created ZIP file can be confirmed from the properties of zip(pre). You can utilize the same settings as a reference in order to specify upload or transfer operations. Utilize the Output to information here.

To help you better understand the script, the set content is shown below for reference.

(1) Path to compress

Specify the directory to compress.

/${Workspaces_Name}/hsq-logs/${Ope_pre_yyyy}/${Ope_pre_MM}/ is entered for the default value. The directory for the workspace Audit_Logs that includes the logs of the previous month is compressed.

(2) Output to

Specify the output destination of the ZIP file and the output file name.

/${Workspaces_Name}/hsq-logs/${Ope_pre_yyyy}/hsq-logs${Ope_pre_yyyy}${Ope_pre_MM}.zip is entered for the default value. ZIP files such as hsq-logs202309.zip are created in the directory for the workspace Audit_Logs.