Articles on: Exporting Logs

Exporting Logs to Google BigQuery

Connecting Patronum Logs to Google BigQuery

This guide explains step by step how to connect Patronum logs to Google BigQuery using a Google Cloud Service Account and BigQuery integration settings inside Patronum.


1. Create a Google Cloud Project

  1. Go to the Google Cloud Console.
  2. Click the Project Dropdown (top navigation bar).
  3. Select an existing project or click New Project.
  4. Enter a project name (e.g., "Patronum Logs Project") and click Create.


2. Enable the BigQuery API

Before using BigQuery, you need to enable the API.

  1. In the Google Cloud Console, go to Search bar at the top.
  2. Type BigQuery API.
  3. Click on it and then click Enable.






3. Create a Service Account

  1. Go to IAM & Admin → Service Accounts.
  2. Click + Create Service Account.
  3. Provide a name (e.g., patronum-logs-sa) and description.
  4. Click Create and Continue.


4. Assign Roles to the Service Account

Assign roles so Patronum can insert logs into BigQuery.

  • BigQuery Data Editor (required for inserting data).
  • BigQuery Admin (optional if you need full control).
  • Logging Admin (optional if exporting logs directly).

Select roles and click Continue → then click Done.


5. Generate and Download the Service Account Key (JSON File)

  1. Open the Service Account you just created.
  2. Go to the Keys tab.
  3. Click Add Key → Create New Key.
  4. Select JSON as the key type.
  5. Click Create → a JSON file will download automatically.

* Important:

  • This is the only time you can download the key.
  • If lost, you must create a new one.


6. Secure the JSON Key File

  • Store it securely (environment variables, encrypted storage, secret manager).
  • Never upload it to GitHub, email, or public locations.
  • Delete unused keys and rotate keys regularly.


7. Configure Patronum with BigQuery

Now that you have the JSON key, connect Patronum to BigQuery:

  1. Login to Patronum App.
  2. Click Settings (left menu).
  3. Go to Integrations.
  4. Expand the Exporting Logs dropdown.







  1. In the Action column, enable BigQuery by clicking the radio button.
  2. In the Configure column, click the Settings (⚙️) icon.
  3. Upload the JSON file (Service Account Key).
  4. Click Next.
  5. Enter Dataset ID:
    • If this is your first time, create one by typing a new Dataset ID.





  1. Click Next.
  2. Enter a Table ID (the table where Patronum logs will be stored).





  1. Click Save.

Patronum is now connected to Google BigQuery.


8. (Optional) Rotate Keys and Manage Security

  • Remove old keys when not in use.
  • Assign only the roles needed (principle of least privilege).
  • Monitor BigQuery logs for security and usage.


9. Where to See Your Logs in Google Cloud

  1. Go to Google Cloud Console.
  2. Open the Navigation Menu → BigQuery.
  3. Expand your Project.
  4. Select your Dataset ID.
  5. Click on your Table ID.
  6. Open the Table Explorer View.
  7. Here, you can view your Patronum logs.(On Preview Tab)






10. Querying Your Logs

You can use SQL queries in BigQuery to analyze your Patronum logs.

For example:



SELECT * 

FROM project_name.datasetID.tableId

LIMIT 50;

This query fetches the last 50 events from your Patronum logs.



Or you can see the referrence below:









Updated on: 20/08/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!