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

Implement 'query-log' #410

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Implement 'query-log' #410

wants to merge 3 commits into from

Conversation

folbricht
Copy link
Owner

@folbricht folbricht commented Sep 1, 2024

Implements #409

Adds a new query-log element that can log to file or STDOUT.

[groups.query-log]
type   = "query-log"
resolvers = ["cloudflare-dot"]
output-file = "/tmp/query.log" # Comment out to log to STDOUT

@folbricht folbricht mentioned this pull request Sep 1, 2024
@cbuijs
Copy link
Contributor

cbuijs commented Sep 25, 2024

Could we add something so that the EDNS-ECS address is display in the log as well, or instead of the client-ip?

@folbricht
Copy link
Owner Author

Can certainly be done. To facilitate more values getting added, it's probably best to also switch to structured logging rather than using more columns.

@folbricht
Copy link
Owner Author

Added that, the output looks like this now:

time=2024-09-29T13:17:12.580+02:00 source-ip=127.0.0.1 question-name=google.com. question-class=IN question-type=A

Wondering if it'd be better to output these as JSON, or at least offer that as an option

@cbuijs
Copy link
Contributor

cbuijs commented Sep 30, 2024

Having plain-text and json as (both) options would be great. Tailing a json file is a bit tricky if you want to monitor (where I use it for).

@folbricht
Copy link
Owner Author

Added support for JSON output (optional). This produces JSONL which can be piped into jq .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants