dehaze

Remove event logs

Space Cloud stores the event logs related to Event Triggers in the event_logs table/collection. If there are lots of events, the event_logs table can get huge, and you may want to prune them. You can use any of the following options to prune your event logs depending on your need.

Note: You can even change the table and database where Space Cloud stores its event logs from the Configure section.

Table structure

The event_logs table managed by Space Cloud has the following structure:

Field Type Description
_id String Unique identifier of an event.
batchid Number Unique identifier of a batch of an event. Used for internal Space Cloud events.
type Number Event type
token String Authorization token
timestamp Number Timestamp of when the event should get executed.
event_timestamp Number Timestamp of when the event was queued.
payload String Event data stringified.
status String Status of event - staged, processed or failed.
retries Number Number of retries performed.
url String Webhook URL.
remark String Reason of failure.

Option 1: Clear only failed events

DELETE from event_logs where status = "failed";
db.event_logs.remove({ status: "failed" })

Option 2: Clear only processed events

DELETE from event_logs where status = "processed";
db.event_logs.remove({ status: "processed" })

Option 3: Clear both failed and processed events

DELETE from event_logs where status = "failed" or status = "processed";
db.event_logs.remove({ status: { $in: ["failed", "processed"]} })

Option 4: Clear only failed events

DELETE from event_logs;
db.event_logs.remove({ })

Have a technical question?

Improve the docs!