Preserve Selections on Long Term Query Log page

Could we make it possible to preserve the query log settings, so when switching to the tab it already has useful data?

I'm not sure I follow...

Hey, the query log shows nothing by default, I usually go deselect permitted (only show blocked) for the timeframe of Today. When I click away from the query log and back, it's reset showing nothing. It'd be great if it persisted the last-used settings. Thanks!

I think this probably goes hand in hand with this topic here:

I've noticed that as well, if you toggle the checkboxes after selecting a timeframe the data does not update. You must then select a timeframe again to get the new filter applied.

Yeah, it looks like the date/range selection is the toggle for refreshing the data, the filters are only applied when data is fetched.

Possibly by design, see @DL6ER's response in the other topic:

We do not trigger a processing when the page is opened to avoid an additional delay until the user can request what they want.

Interesting to see that it was intentional, I think that's a sensible choice though would argue that if the user usually wants the same thing (in my case) then allowing the preference of a default would be a nice touch. It would still make sense to leave it blank out of the box, could we implement something like that?

Essentially sometimes a site is being blocked and it's pushed out quickly because there's more activity than 100 items (the normal query log max), so the long term query log becomes more of a kitchen knife than a scalpel in that case.

We could maybe go as far as storing the state of the checkboxes in the browsers localstorage, as we do with a couple of other things.

There are also filters in place on the main query log page, and if you select "show all"

Though I've been looking at making those filters a bit more intuitive, too.

Edit: I've converted this thread to a feature request for community voting

1 Like

Thanks! Let's see if we get some votes.

I did see that you could filter and show all, though don't think the filtering would be as easy as preserved settings in the long term query log. For some reason "Show All" is returning an error, but that's a different issue.

An unknown error occured while loading the data.
Also noticed a typo occured -> occurred

Yes, as I described in the linked document. Processing long-term data takes time. Maybe up to minutes depending on what you selected, if you installed Pi-hole on a NAS/Pogoloug or whatever it was even designed to run on. This makes the page useless in this period of data loading. A user cannot start a second operation and cannot terminate the running process (this would be very complicated).

Hence, I'm in the team of: you have to click a button to get what you really want. Not what you wanted yesterday or whenever you last visited this page.

We can surely look at trying to preserve the check-boxes on a per-browser basis.


Yes, you have likely too many queries in your network and your Pi-hole instance runs into an out-of-memory error when requesting details about them all. Try searching the forum for "PHP memory" or similar.

That'd be sufficient! If it preserved the checkboxes and timeframe, and had a "Go" button of some sort, that'd be satisfying both concerns.

Really all I want is a list of the last 20 or so unique blocked URL's, if there were some other interface offering that I wouldn't need to use the long term query log.

The command line can do this. Example:

sqlite3 /etc/pihole/pihole-FTL.db "select domain, count(domain) from queries where timestamp>=strftime('%s','now')-604800 group by domain order by count(domain) desc Limit 20"

top blocked domains (limited to 20 in this instance) for the past 7 days