Skip to content

Log clean

Removing Logs from Database

DELETE FROM events
WHERE account = ''
AND workspace = ''
AND event = 'prefect.log.write'
-- give a range on occurred if you can, it will speed things up
AND resource_id = 'prefect.flow-run/task-run.<run-id>';

-- if it's a flow run you also need to do this
DELETE FROM events
WHERE account = ''
AND workspace = ''
AND event = 'prefect.log.write'
-- give a range on `occurred` if you can, it will speed things up
AND related_resource_ids && '{prefect.flow-run.<run-id>}'::text[]);