Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querylogs older_than doesn't work with most values #4252

Closed
aperullo opened this issue Feb 5, 2022 · 1 comment
Closed

Querylogs older_than doesn't work with most values #4252

aperullo opened this issue Feb 5, 2022 · 1 comment
Labels
duplicate Duplicate or merged issues.

Comments

@aperullo
Copy link

aperullo commented 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

@aperullo aperullo changed the title Querylogs older_than doesn't work with most values Bug: Querylogs older_than doesn't work with most values Feb 5, 2022
@ainar-g ainar-g changed the title Bug: Querylogs older_than doesn't work with most values Querylogs older_than doesn't work with most values Feb 7, 2022
@ainar-g
Copy link
Contributor

ainar-g commented 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 ainar-g closed this as completed Feb 7, 2022
@ainar-g ainar-g added the duplicate Duplicate or merged issues. label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate or merged issues.
Projects
None yet
Development

No branches or pull requests

2 participants