How to clear the audit log?

How can I clear the audit log? I have accidentally clicked the audit button trying to figure out what it does but I would like to still see that domain.

You can manually edit file /etc/pihole/auditlog.list and remove the undesired entry.

While this works, it would be convenient to have a section in the web GUI to remove Audited domains.

The file at ‘/etc/pihole/auditlog.list’ Is empty (on 1 of my devices), I am really confused.

Which version of Pi-hole do you use?

I use the 5.0 beta, sorry I should have specified.

Yes, so audit log is stored in the database /etc/pihole/gravity.db, see, e.g.,

sqlite3 /etc/pihole/gravity.db "SELECT * FROM domain_audit;"

You can remove single domains (example: using

sudo sqlite3 /etc/pihole/gravity.db "DELETE FROM domain_audit WHERE domain = '';"

or purge the entire list without specifying a specific domain:

sudo sqlite3 /etc/pihole/gravity.db "DELETE FROM domain_audit;"
1 Like

In a later 5.0 beta/release will there be an easier method of clearing audit logs? This would be very helpful.

This is not planned, at least not for the near future, at least not that I would know.

It is really an edge feature very few users are actually using. Adding a domain management here will be a lot of maintenance overhead, potentially slowing down the entire development of Pi-hole. You are invited, of course, to submit a feature request so the community can vote on it if there isn’t already one. The best chance would obviously be to contribute code so we would not need to code everything ourselves.