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

Bind 9.11 Log Format #2

Open
mdrisser opened this issue Jun 5, 2018 · 3 comments
Open

Bind 9.11 Log Format #2

mdrisser opened this issue Jun 5, 2018 · 3 comments

Comments

@mdrisser
Copy link

mdrisser commented Jun 5, 2018

After a recent upgrade of my systems to Ubuntu 18.04 which provides Bind 9.11.3 I found that your script wouldn't parse the log files. I fixed the issue by adding the following to process_query at line 179:

"""
# Bind 9.11
04-Jun-2018 14:48:15.540 queries: info: client @0x7fda1d74e7d0 \
192.168.1.6#60844 (prefetch.net): query: prefetch.net IN A +E(0)D \
(192.168.1.250)
"""
    elif len(chopped) == 10:
        timestamp = chopped[0] + " " + chopped[1]
        """ Had to change the item reference in chopped[] below because they added a memory location
             in the middle of everything, instead of putting it at the end
        """
        client_ip = chopped[3].split("#")[0]
        """ That also shifted the rr_type over
        """
        rr_type = chopped[7]
        dns_question = chopped[4]

I hope this helps.

@Matty9191
Copy link
Owner

Is this the entry that is showing up in your logs?:

04-Jun-2018 14:48:15.540 queries: info: client @0x7fda1d74e7d0
192.168.1.6#60844 (prefetch.net): query: prefetch.net IN A +E(0)D
(192.168.1.250)

Want to triple check before committing the change.

@mdrisser
Copy link
Author

mdrisser commented Jun 6, 2018 via email

@callesoe
Copy link

callesoe commented Feb 9, 2021

I ran into the same problem and can confirm the provided fix, here's the diff without the comments (oddly, it needs to be added at line 174 not 179):

173a174,179
>     elif len(chopped) == 10:
>         timestamp = chopped[0] + " " + chopped[1]
>         client_ip = chopped[3].split("#")[0]
>         rr_type = chopped[7]
>         dns_question = chopped[4]
>

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

3 participants