Query Log - Show [Last day] [Custom]

The ability I am lacking is to easily see logs from the last day without diving into the .db file. Why can't we have the option to pick a date range and display the query logs from that time frame? 100 most of the time doesn't show me anything, and [show all] freezes on my pi and never runs.

If it is a performance issue with the number of queries on your Pi-hole for that day, or the limitations of the hardware, this won't be resolved if we simply move the commands to a different tab (long term data to query log). The information comes from the same place, the long term database.

The query log and dashboard only have information for the past 24 hours, not the entire previous day. The previous day information cannot be retrieved fully from memory.

An alternative that may meet your needs is to look at the dnsmasq log for the previous day, which is located at /var/log/pihole.log.1.

You can look at this date and filter as needed - if you want all the queries from one IP, for example, this command would quickly provide the output:

grep query /var/log/pihole.log.1 | grep 192.168.0.135 | tail -n5
May 11 23:59:21 dnsmasq[17819]: query[A] api.mixpanel.com from 192.168.0.135
May 11 23:59:34 dnsmasq[17819]: query[A] ocsp.apple.com from 192.168.0.135
May 11 23:59:34 dnsmasq[17819]: query[A] aa.google.com from 192.168.0.135
May 11 23:59:34 dnsmasq[17819]: query[A] mesu.apple.com from 192.168.0.135
May 12 00:00:00 dnsmasq[17819]: query[A] api.weather.com from 192.168.0.135

Are you looking for "Long Term Database /Queries"?

1 Like

Already implemented with Long Term Database/Queries.

v6 will unify the Query log and the long term databse - so this feature is implemented already.