The main goal of this code is to create a basic dnstap printing tool based on the golang-dnstap library.

dnstap-parse

The main goal of this code is to create a basic dnstap printing tool based on the golang-dnstap library.

The output is supposed to mimic the "short summary format" of dnstap-read from BIND but with the possibility of adding additional information via flags so you can easily grep for such things (currently DNS ID via -id)

Usage of ./dnstap-parse:
  -cpuprofile string
    	write cpu profile to file
  -file string
    	read dnstap data from file
  -id
    	include DNS ID in output

The -cpuprofile flag is not helpful for ordinary usage, it is just there to be able to profile the tool.

Known output differences with dnstap-read

From investigating dnstap files in the wild I have noticed some instances where the output of this tool and dnstap-read differs. Specifically the character escaping rules used by dnstap-read and miekg/dns differ somewhat.

One example of this is how 0x20 (space) is represented in domain names, where miekg/dns will present it as \ and dnstap-read will present it as \032 leading to this tool outputting example\ lookup/IN/A while dnstap-read will print example\032lookup/IN/A.

Another example of this is the 0x27 (') character which is not escaped at all by dnstap-read, but is escpaed in miekg/dns due to being defined as special in isDomainNameLabelSpecial()

This results in dnstap-read outputting example'lookup/IN/A while this tool prints example\'lookup/IN/A.

The overall character espacing rules used by miekg/dns can be found in UnpackDomainName()

Similar Resources

efaceconv - Code generation tool for high performance conversion from interface{} to immutable type without allocations.

efaceconv High performance conversion from interface{} to immutable types without additional allocations This is tool for go generate and common lib (

May 14, 2022

A concurrent rate limiter library for Golang based on Sliding-Window rate limiter algorithm.

ratelimiter A generic concurrent rate limiter library for Golang based on Sliding-window rate limitng algorithm. The implementation of rate-limiter al

Jan 6, 2023

Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al.

Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al.

Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al. This library is external dependency-free. It only depends on the Go standard library.

Dec 27, 2022

A fully Go userland with Linux bootloaders! u-root can create a one-binary root file system (initramfs) containing a busybox-like set of tools written in Go.

u-root Description u-root embodies four different projects. Go versions of many standard Linux tools, such as ls, cp, or shutdown. See cmds/core for m

Dec 29, 2022

Create deep copies (clones) of your maps and slices without using reflection.

DeepCopy DeepCopy helps you create deep copies (clones) of your maps and slices. Create deep copies (clones) of your objects The package is based on t

Nov 20, 2022

A helper function to create a pointer to a new object in Go 1.18+

A helper function to create a pointer to a new object in Go 1.18+

A helper function to create a pointer to a new object in Go 1.18+

Nov 9, 2022

Code Generation for Functional Programming, Concurrency and Generics in Golang

goderive goderive derives mundane golang functions that you do not want to maintain and keeps them up to date. It does this by parsing your go code fo

Dec 25, 2022

Golang source code parsing, usage like reflect package

gotype Golang source code parsing, usage like reflect package English 简体中文 Usage API Documentation Examples License Pouch is licensed under the MIT Li

Dec 9, 2022

this is a easy breaker by golang code

tfgo-breaker 1. Intro This is a easy breaker by golang code. U can use it in your project quickly. Support function break, timeout, auto dry-run. 2. D

Sep 17, 2022
Maintain a lower-bitrate copy of a music library in sync with the main copy.

msync Maintain a lower-bitrate copy of your music library, in sync with the main copy.

Mar 6, 2022
go-to64 analyzes Golang main package to convert int/uint to int64/uint64.

go-to64 About go-to64 analyzes Golang main package to convert int/uint to int64/uint64. This is an experiment tool, so be very careful. In a 32-bit en

Oct 31, 2021
🍀 Go basic library. || Go语言基础库
🍀 Go basic library. || Go语言基础库

Go语言基础库 工程目录说明 pkg/ ...... 源码包 |-- bininfo/ ...... 将编译时源码的git版本信息(当前commit log的sha值和commit message),编译时间,Go版本,平台打入程序中

Dec 28, 2022
Minimalistic library for basic matrix operations.

MATRIX Maybe a bit slow, but minimalistic library for basic matrix operations. Available functions Function signature Description Equal(a, b [][]float

Nov 4, 2021
Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.
Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.

Clean-Swift source & test code auto generator Overview Run Output Basic Usage make config.yaml target_project_name: Miro // target project name copyri

Apr 13, 2022
Code generator that generates boilerplate code for a go http server

http-bootstrapper This is a code generator that uses go templates to generate a bootstrap code for a go http server. Usage Generate go http server cod

Nov 20, 2021
Cpu-profiling - Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

cpu-profiling Basic example of CPU Profiling in Golang which shows the bottlenec

Aug 2, 2022
Little helper to create tar balls of an executable together with its ELF shared library dependencies.

Little helper to create tar balls of an executable together with its ELF shared library dependencies. This is useful for prototyping with gokrazy: htt

Sep 7, 2022
A prototype code-generator library for golang.

A prototype code-generator library for golang.

Jul 28, 2022
A Golang tool to whitelist ASN's based on organization name

A Golang tool to whitelist ASN's based on organization name. This works by providing a list of ASN org names. This tool uses goPacket to monitor incoming traffic, capturing the IP's and checking the IP to see if it is a part of a whitelisted ASN. If it is not, it blocks that connection and future connections using iptables.

Jul 23, 2022