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

Please add connection "peer" to default text-format directives #605

Closed
peterand-pa opened this issue Feb 12, 2024 · 3 comments
Closed

Please add connection "peer" to default text-format directives #605

peterand-pa opened this issue Feb 12, 2024 · 3 comments

Comments

@peterand-pa
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I need to be able to log the source of the dnstap message

Describe the solution you'd like
A new text-format directive

Describe alternatives you've considered
Overriding dnstap identity string

Additional context
None

@dmachard
Copy link
Owner

Can you share a example ?

@peterand-pa
Copy link
Contributor Author

Actually , for us peername would be better.
So generally speaking , any logging should reflect the source of the dnstap message ( the connection peer ) because that is usually the DNS server.
Having the DNS server - not the dnscollector server - as the source host in the centralised splunk logs is very important.
( we plan to have 14 DNS appliances sending dnstap to one central location with about 40K queries per second )
Similiar to my other request #588 .

In ./collectors/dnstap.go , there's a line peer := conn.RemoteAddr().String() .
I'd also add a gethostbyname to get the hostname of the peer .
Unfortunately , I don't know enough about dnscollector's data structures and how that info would get accessed in a logger .

So, because it'd have to cater for multiple peer connections , I'd suggest it gets added to the dnstap message structure ( dm )

Then by making those text-format directives available, loggers could use that data in the text-format .
eg
text-format: "timestamp-rfc3339ns peername operation rcode queryip queryport family protocol length qname qtype latency"

@dmachard
Copy link
Owner

It will be implemented for next release.

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

No branches or pull requests

2 participants