CMS Development

IrinaL
Member

serverless function audit logs

SOLVE

Hello HubSpot Community,

 

Our company is on the Enterprise plan, and we use serverless functions for private apps.

 

For audit purposes, I need to automate the weekly export of serverless function audit logs. I've checked the HubSpot API, and it seems that there is no endpoint returning the necessary data.

 

What solution or API is available to automate this process?

0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

serverless function audit logs

SOLVE

Hi @IrinaL,

 

At the moment it does not appear that there is a way to automate the export of serverless function audit logs.

 

A potential workaround could be having each of your serverless functions send logs to an external logging service (i.e. AWS CloudWatch) and do the automated exports there. 

✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
2 Replies 2
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

serverless function audit logs

SOLVE

Hi @IrinaL,

 

At the moment it does not appear that there is a way to automate the export of serverless function audit logs.

 

A potential workaround could be having each of your serverless functions send logs to an external logging service (i.e. AWS CloudWatch) and do the automated exports there. 

✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes
Nhal
Member

serverless function audit logs

SOLVE

Ah, I’ve run into this too. Feels like an oversight on HubSpot’s part. Just to check, are you already piping your logs somewhere like AWS CloudWatch or S3? If not, a quick win is to manually log your serverless function events inside each function and push them to CloudWatch using something like console.log() or a custom log handler. Once they land there, you can use a scheduled Lambda or CloudWatch subscription filter to export weekly. I had a setup once where we used EventBridge to trigger a log exporter every Friday and dumped it to S3 as a CSV. Not perfect, but it worked. Let me know how you're currently capturing logs, and I can help map it out.

0 Upvotes