# Request: Statistic reset

**URL:** <https://discourse.pi-hole.net/t/request-statistic-reset/28167>\
**Category:** Feature Requests\
**Created:** [February 11, 2020, 9:09pm UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167 "2020-02-11T21:09:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TschernoBill](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/t/7c8e57/32.png) [@TschernoBill](https://discourse.pi-hole.net/u/TschernoBill)\
**Post date:** [February 11, 2020, 9:09pm UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167/1 "2020-02-11T21:09:07Z")

</div>

**Please follow the below template, it will help us to help you!**

**Please ensure that you are running the latest version of the beta code.**  
_Run pihole -up to update to the latest, then verify that the problem still exists before reporting it._

## **Problem with Beta 5.0:**

## **Debug Token:**

Is it possible to add a (safe) function to reset the ftl-statistics? While searching for it I only found a solution by deleting the old database.

An example where this is usefull: Getting a exact view on the summary after deleting or deactivating an upstream-DNS.

Thanks in advance to all of you for the awesome work!

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [February 15, 2020, 5:27pm UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167/2 "2020-02-15T17:27:57Z")

</div>

You could try

```auto
sudo service pihole-FTL stop
sudo sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM queries WHERE timestamp > (cast(strftime('%s', 'now') as int))-24*60*60"
sudo service pihole-FTL start

```

This will selectively remove the last 24 hours without destroying the entire database.

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [June 1, 2020, 9:28pm UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167/3 "2020-06-01T21:28:07Z")

</div>

I think this would nicely fit into the "Danger Zone!" in Settings/System

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [June 1, 2020, 10:38pm UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167/4 "2020-06-01T22:38:46Z")

</div>

I don't agree. This is not a frequently performed task and generally falls into the "edge case" category. Adding code for this occasional use is not warranted, in my opinion.

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [June 2, 2020, 6:15am UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167/5 "2020-06-02T06:15:49Z")

</div>

How often do you press "Flush logs" or "Disable query logging"?

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [August 4, 2020, 4:06pm UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167/7 "2020-08-04T16:06:10Z")

</div>

Flushing logs does flush the long-term database, but only the last 24h. This seems a bit counterintuitive - why does it flush at all (not not just the logs) and why not all data?

> <https://github.com/pi-hole/pi-hole/blob/56cd7c4d59ceb629a2170cd1c8ab78ef26366019/advanced/Scripts/piholeLogFlush.sh#L60>

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [August 4, 2020, 4:20pm UTC](https://discourse.pi-hole.net/t/request-statistic-reset/28167/8 "2020-08-04T16:20:41Z")

</div>

> [@yubiuser](#):
>
> why does it flush at all ( ~~not~~ not just the logs)

Because it involves an FTL restart. And FTL would re-import the history when it would still be in the database. The net effect would be that everything looks to be still there.

> [@yubiuser](#):
>
> why not all data

Because this was originally meant more in a "I want to hide some things happened recently" way. Very much like browsers offer you to delete the data only partially (without loosing _everything_). I can see that there may be a need to get both. However, flushing the entirety of the logs can easily be obtained by deleting the database. Flushing it only partially is a bit more involved as you need an SQL instruction.
