Export Logs

Export logs help to transfer the access logs in CSV format and then downloads the file. Only administrator can handle this. This depends on the parameters like timezone, filters that can be applied and if sorting is needed.

API Calls

/v1.14/accesslogs/exportcsv

/v1.14/auditlogs/exportcsv

Export Access Logs

Description This API exports the access logs to the CSV format and downloads the CSV file.
Guest Manager users with the Administrator role or the Analyst role can access this API.
Syntax
GET <Base_URL>/accesslogs/exportcsv?timezone=<value>&filter=<value>&sort=<value>

Here,

  • timezone

    It takes a String value indicating the timezone in which the date and time have to be represented in the logs.
    If timezone is not specified then UTC is used.

  • filter

    It takes a JSON value of the form:
    {“property”:”prop_name”,”value”:”prop_value”,”operator”:”comparison_operator”}
    Here,

    • property

      Property is a parameter in the visitor log on which the logs have to be filtered. For example, username.

    • value

      It specifies the property value to be used for filtering.

    • operator

      It is the comparison operator to be used for filtering the logs. The applicable operators are ‘=’, ‘!=’, ‘<>’, ‘<‘, ‘<=’, ‘>’, ‘>=’, ‘like’.

  • sort

    It takes a JSON value of the form:
    {“property”:”prop_name”,”direction”:”value”}
    Here,

    • property

      It is a parameter in the log on which the logs have to be sorted. For example, username.

    • direction

      It specifies sorting order. The applicable values are “asc” and “desc”.

Sample code
GET https://analyticsdemo.mojonetworks.com/api/v1.14/accesslogs/exportcsv?timezone=”Asia/Kolkata”&filter={“property”:”username”,”value”:”john.snow”,”operator”:”=”}&sort={“property”:”username”,”direction”:”asc”}
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The API exports the logs to CSV format and starts downloading the CSV file.

Export Audit Logs

Description This API exports the audit logs to the CSV format and downloads the CSV file.
Guest Manager users with the Administrator role or the Analyst role can access this API.
Syntax
GET <Base_URL>/auditlogs/exportcsv?timezone=<value>&filter=<value>&sort=<value>

Here,

  • timezone

    It takes a String value indicating the timezone in which the date and time have to be represented in the logs. If the timezone is not specified then UTC is used.

  • filter

    It takes a JSON value of the form:
    {“property”:”prop_name”,”value”:”prop_value”,”operator”:”comparison_operator”}
    Here,

    • property

      Property is a parameter in the visitor log on which the logs have to be filtered. For example, username.

    • value

      It specifies the property value to be used for filtering.

    • operator

      It is the comparison operator to be used for filtering the logs. The applicable operators are ‘=’, ‘!=’, ‘<>’, ‘<‘, ‘<=’, ‘>’, ‘>=’, ‘like’.

  • sort

    It takes a JSON value of the form:
    {“property”:”prop_name”,”direction”:”value”}
    Here,

    • property

      It is a parameter in the log on which the logs have to be sorted. For example, username.

    • direction

      It specifies sorting order. The applicable values are “asc” and “desc”.

Sample code
GET https://analyticsdemo.mojonetworks.com/api/v1.14/auditlogs/exportcsv?timezone=”Asia/Kolkata”&filter={“property”:”username”,”value”:”john.snow”,”operator”:”=”}&sort={“property”:”username”,”direction”:”asc”}
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The API exports the logs to CSV format and starts downloading the CSV file.