Querylogs older_than doesn't work with most values #3457

Closed
opened 2026-03-04 03:40:30 -05:00 by deekerman · 1 comment
Owner

Originally created by @aperullo on GitHub (Feb 5, 2022).

Issue Details

  • Version of AdGuard Home server:
    • latest
  • How did you install AdGuard Home:
    • Docker
  • CPU architecture:
    • arm
  • Operating system and version:
    • raspberry pi 4

When using the /control/querylog endpoint of Adguard Home API, the older_than parameter doesn't work unless the timestamp passed to it is one that exists on a record in the querylogs.

In my case, going to the following in my browser returns query logs as expected, because this timestamp is in my instance.

http://<adguard_addr>/control/querylog?search=&response_status=all&older_than=2022-02-02T03:25:57.195605Z

{"data":[{"answer":[{"type":"A","value":"...","ttl":172}],"answer_dnssec":false,"cached":true,
...

So there is logs from the 2nd. But If I change the timestamp to the 3rd like below.
`http://<adguard_addr>/control/querylog?search=&response_status=all&older_than=2022-03-02T03:25:57.195605Z``

{"data":[],"oldest":""}

I receive no data back even though there is definitely logs older than that.

Likewise I cannot search for most timestamps since they don't appear in the querylogs.

Expected Behavior

The api should return records older than any given timestamp, regardless of whether it is in an entry the querylogs.

Additional information

This bug doesn't happen with any date that is in the future. For a time stamp such as 2100-01-01T00:00:00.000000Z or even 2023-01-01T00:00:00.000000Z, the endpoint works as expected. It seems to only occur with a timestamp in the past, that also isn't in the querylogs

Originally created by @aperullo on GitHub (Feb 5, 2022). ### Issue Details <!-- Please include all relevant details about the environment you experienced the bug in. If possible, include the result of running `./AdGuardHome -v --version` from the installation directory. --> * **Version of AdGuard Home server:** * latest * **How did you install AdGuard Home:** * Docker * **CPU architecture:** * arm * **Operating system and version:** * raspberry pi 4 When using the `/control/querylog` endpoint of Adguard Home API, the `older_than` parameter doesn't work unless the timestamp passed to it is one that exists on a record in the querylogs. In my case, going to the following in my browser returns query logs as expected, because this timestamp is in my instance. `http://<adguard_addr>/control/querylog?search=&response_status=all&older_than=2022-02-02T03:25:57.195605Z` ``` {"data":[{"answer":[{"type":"A","value":"...","ttl":172}],"answer_dnssec":false,"cached":true, ... ``` So there is logs from the 2nd. But If I change the timestamp to the 3rd like below. `http://<adguard_addr>/control/querylog?search=&response_status=all&older_than=2022-03-02T03:25:57.195605Z`` ``` {"data":[],"oldest":""} ``` I receive no data back even though there is definitely logs older than that. Likewise I cannot search for most timestamps since they don't appear in the querylogs. ### Expected Behavior The api should return records older than any given timestamp, regardless of whether it is in an entry the querylogs. ### Additional information This bug doesn't happen with any date that is in the future. For a time stamp such as `2100-01-01T00:00:00.000000Z` or even `2023-01-01T00:00:00.000000Z`, the endpoint works as expected. It seems to only occur with a timestamp in the past, that also isn't in the querylogs
deekerman 2026-03-04 03:40:30 -05:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@ainar-g commented on GitHub (Feb 7, 2022):

Hello. The current query log API is really only designed to work with an infinite-scroll type UIs. That is, load the first page, take the last record, load the next set, repeat.

We're rewriting the API in v0.108 to make it possible to do all kinds of filtering. The issue about that is #481, and I'm going to merge this issue into that one, if you don't mind.

@ainar-g commented on GitHub (Feb 7, 2022): Hello. The current query log API is really only designed to work with an infinite-scroll type UIs. That is, load the first page, take the last record, load the next set, repeat. We're rewriting the API in v0.108 to make it possible to do all kinds of filtering. The issue about that is #481, and I'm going to merge this issue into that one, if you don't mind.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AdGuardHome#3457
No description provided.