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

Latency field value problem #11

Open
blakkheimgw opened this issue Feb 22, 2024 · 3 comments
Open

Latency field value problem #11

blakkheimgw opened this issue Feb 22, 2024 · 3 comments

Comments

@blakkheimgw
Copy link

blakkheimgw commented Feb 22, 2024

Hello,

I use this piece of software to forward in JSON format the queries events to our SIEM product. But I noticed that for some packets, the latency field value is not quoted, so the JSON parsing is impossible in our SIEM.

Latency field value quoted :
{"dns_message": "CLIENT_RESPONSE", "socket_family": "IPv4", "socket protocol": "UDP", "from_address": "1.2.3.4", "to_address": "2.2.3.3", "query_time": "2024-02-22T13:19:29.186304+00:00", "response_time": "2024-02-22T13:19:29.363495+00:00", "latency": 0.177191, "query_type": "A", "query_name": "example.com.", "return_code": "SERVFAIL", "bytes": 31}

And another one unquoted :
{"dns_message": "CLIENT_RESPONSE", "socket_family": "IPv4", "socket protocol": "UDP", "from_address": "1.2.3.4", "to_address": "2.2.3.3", "query_time": "2024-02-22T12:47:20.758735+00:00", "response_time": "2024-02-22T12:47:20.758832+00:00", "latency": 9.7e-05, "query_type": "A", "query_name": "good.fqdn.com.", "return_code": "NOERROR", "bytes": 90}

Could you look into this issue please ?

Best regards.

EDIT : both values are unquoted as they are considered as integers I think. But the format with the exponent inside is not recognized by our logs receivers as a valid value.

@blakkheimgw
Copy link
Author

I've managed to workaround this issue by disabling scientific notation in receiver.py :
time_latency = f'{time_latency:.9f}'
Maybe some logs receivers can manage with this notation, ours not. Maybe we could manage this with a wrapper script option ?

@dmachard
Copy link
Collaborator

Can you switch to the DNScollector tool ?
A full support of the PowerDNS protobuf is implemented.

@blakkheimgw
Copy link
Author

Hello @dmachard and thank you for the hint. I'll give it a try 👍

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

No branches or pull requests

2 participants