# Improve dashboard stats link to query log

**URL:** <https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653>\
**Category:** Beta 5.0\
**Created:** [April 16, 2020, 6:16pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653 "2020-04-16T18:16:18Z")\
**Posts on this page:** 9\
**Page:** 1

<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:** [April 16, 2020, 6:16pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/1 "2020-04-16T18:16:18Z")

</div>

I've noticed one issue and a few minor inconsistencies with the links from the dashboard stats to the query log.

Issue:  
Clicking on Top Clients (blocked only) one would expect to see only blocked queries from that client. But the query log shows all queries from that client (within the last 24h).

Inconsistencies:

1. Clicking on one of the following opens the query log:  
"Query Typs"/"Queries answered by"/"Top permitted domains"/"Top blocked domains"/"Top Clients (total)"/"Top Clients (blocked only)"  
In the header of the query log it stats "Recent Queries" but in fact it is (and would be better called) "Queries in the last 24h"

2. Clicking on "Query Typs" or "Queries answered by" opens the query log:  
In the header of the query log it stats "Show up to 100" but in fact it is shows all queries from the last 24h

```auto
nanopi@nanopi:~$ pihole -v
  Pi-hole version is v4.3.5-462-g0f20470 (Latest: v4.4)
  AdminLTE version is v4.3.2-464-gade3ef5 (Latest: v4.3.3)
  FTL version is vDev-853261b (Latest: v4.3.1)

```

---

<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:** [April 16, 2020, 6:34pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/2 "2020-04-16T18:34:57Z")

</div>

> [@yubiuser](#):
>
> Clicking on “Query Typs” or “Queries answered by” opens the query log:  
> In the header it stats “Show up to 100” but in fact it is shows all queries from the last 24h

That's not what I see on my dashboard.

 ![image](https://discourse.pi-hole.net/uploads/default/original/2X/a/a4e60624289492da0b97dc559ef4f0ae886ec401.jpeg)

When the query log opens, the top is hard coded to say 100 queries, but only the number of queries selected in the pull down is shown. The pull down selection is sticky and should be the same as the last time that menu was used. Is that the same as what you are seeing?

 ![image](https://discourse.pi-hole.net/uploads/default/original/2X/5/534ff301f1e0c1c63b268a49ef8d9a6e8256b696.jpeg)

---

<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:** [April 16, 2020, 6:43pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/3 "2020-04-16T18:43:16Z")

</div>

I see the same. The issue is:

The 100 is hard coded and comes from the "normal" way to the query log (click on "Query log" on the left side of the page). If you do so max 100 entries are shown and the drop-down "100" is equal "all".

But accessing the query log via Dashboard -\> "Queries answered by" more than 100 entries are loaded (in your case 7795) and in the drop-down all !=100 anymore. If the sticky selection is "all" the term "showing up to 100 queries" is wrong.

---

<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:** [April 16, 2020, 6:45pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/4 "2020-04-16T18:45:46Z")

</div>

So, the fix should be to change the wording as follows.

> Recent Queries (showing up to 100 queries), show all

to

> Queries in the last 24 hours, show all

---

<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:** [April 16, 2020, 6:50pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/5 "2020-04-16T18:50:26Z")

</div>

Yes.  
For the two minor inconsistencies the fix is pure wording.

---

<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:** [April 16, 2020, 8:38pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/6 "2020-04-16T20:38:53Z")

</div>

> [@yubiuser](#):
>
> In the header of the query log it stats “Recent Queries” but in fact it is (and would be better called) “Queries in the last 24h”

I disagree. Even when the 24 hours is hard-coded, this value can be changed by the user when compiling FTL from source without any chance for the web interface to detect this change. In such a case, we'd show incorrect information. The current formulation was explicitly chosen to be implicit.

> [@yubiuser](#):
>
> Clicking on “Query Typs” or “Queries answered by” opens the query log:  
> In the header of the query log it stats “Show up to 100” but in fact it is shows all queries from the last 24h

Confirmed. We will fix this. Even more, this also happens when clicking on clients.

> [@yubiuser](#):
>
> Clicking on Top Clients (blocked only) one would expect to see only blocked queries from that client. But the query log shows all queries from that client (within the last 24h).

Multi-dimensional filtering is not available currently (filtering by both, a client, and a query type). So this is a new feature. I added this now to the API, however, it also requires an update of the FTL daemon which is providing you with all the data.

Try it using

```plaintext
pihole checkout web fix/wording_query_log_links
pihole checkout ftl new/query_log_blocked_client_filtering

```

---

<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:** [April 16, 2020, 9:06pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/7 "2020-04-16T21:06:39Z")

</div>

> [@DL6ER](#):
>
> disagree. Even when the 24 hours is hard-coded, this value can be changed by the user when compiling FTL from source without any chance for the web interface to detect this change. In such a case, we’d show incorrect information.

Ok, point for you. I've never thought about compiling FTL from source just to change the time frame for the stats at the dashboard...  
I still think an additional information what "recent" means in this case would be useful for users. In the "normal" query log this information is given by "up to 100 queries". I'll go and [open an feature request on this](https://discourse.pi-hole.net/t/add-time-range-info-to-all-items-on-dashboard/30680) (as I also think the headings on the dashboard modules could benefit from an info about the includes time frame)

> [@DL6ER](#):
>
> Even more, this also happens when clicking on clients.

Mhh.. not for me. Clicking on one client in "Top Clients (total)" gives  
 ![Bildschirmfoto zu 2020-04-16 22-51-03](https://discourse-cdn.pi-hole.net/uploads/default/optimized/2X/a/a36f02e7c5bd6e145d63f7ba0c2dd1d8cb5a953b_2_690x63.png)

> [@DL6ER](#):
>
> Try it using

Will do tmw morning.

Thanks for your always fast response.

---

<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:** [April 17, 2020, 8:05am UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/11 "2020-04-17T08:05:03Z")

</div>

Can confirm the fix is working.

Two minor things:

1. The link from "Top Clients (blocked only)" does include `status= unknown` in the query log in contrast to the dashboard view. Result is a slightly increased blocked requests count.

 ![Bildschirmfoto zu 2020-04-17 09-46-29](https://discourse.pi-hole.net/uploads/default/original/2X/e/e9251bb7460a3a9c5864a1f7e27f1c093cf24f29.png)

1. There is no link from "Client activity over last 24 hours" to the query log at all. Would be nice to have the same as in "Total queries over last 24 hours" (clicking on one bar queries the log for that particular times range). No need to filter for individual clients here as it is too hard to precisely hit one client.

---

<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 2, 2020, 6:05pm UTC](https://discourse.pi-hole.net/t/improve-dashboard-stats-link-to-query-log/30653/17 "2020-08-02T18:05:57Z")

</div>

As mentioned in the other thread, I forgot about this and just opened PRs for this.

[https://github.com/pi-hole/AdminLTE/pull/1541](https://github.com/pi-hole/AdminLTE/pull/1541)  
[https://github.com/pi-hole/FTL/pull/856](https://github.com/pi-hole/FTL/pull/856)

> [@yubiuser](#):
>
> The link from “Top Clients (blocked only)” does include `status= unknown` in the query log in contrast to the dashboard view. Result is a slightly increased blocked requests count.

Hmm, yeah, _UNKNOWN_ was not handled explicitly during filtering. I changed this now to only show such queries when no filtering for either only-permitted or only-blocked has been requested.

> [@yubiuser](#):
>
> There is no link from “Client activity over last 24 hours” to the query log at all. Would be nice to have the same as in “Total queries over last 24 hours” (clicking on one bar queries the log for that particular times range). No need to filter for individual clients here as it is too hard to precisely hit one client.

Done as well now, thanks again for your feedback.
