jsonlog

package module
v0.0.0-...-bd41390 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2025 License: BSD-3-Clause Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

The jsonlog plugin allows exporting dns queries to a postgres database or to influxdb.

Documentation

Overview

Example config: jsonlog { enable_superapi influxdb http://192.168.0.193:8086/ test dns_data base64keyhere== # pgdb postgresql://crate@192.168.0.193:5432/doc }

Index

Constants

View Source
const (
	CLIENT_MEMORY_LOG_COUNT int = 1024
)

Variables

View Source
var CONFIG_PATH = TEST_PREFIX + "/state/dns/log_rules.json"
View Source
var Configmtx sync.Mutex
View Source
var EventMemoryIdx = make(map[string]int)
View Source
var EventMemoryMtx sync.Mutex
View Source
var TEST_PREFIX = os.Getenv("TEST_PREFIX")
View Source
var UNIX_PLUGIN_LISTENER = TEST_PREFIX + "/state/dns/dns_log_plugin"

Functions

This section is empty.

Types

type DNSEvent

type DNSEvent struct {
	dns.ResponseWriter
	// contains filtered or unexported fields
}

func (*DNSEvent) String

func (i *DNSEvent) String() string

func (*DNSEvent) Write

func (i *DNSEvent) Write(b []byte) (int, error)

func (*DNSEvent) WriteMsg

func (i *DNSEvent) WriteMsg(m *dns.Msg) error

type DeviceEntry

type DeviceEntry struct {
	Name             string
	MAC              string
	WGPubKey         string
	VLANTag          string
	RecentIP         string
	Policies         []string
	Groups           []string
	DeviceTags       []string
	DHCPFirstTime    string
	DHCPLastTime     string
	DeviceExpiration int64
	DeleteExpiration bool
	DeviceDisabled   bool //tbd deprecate this in favor of only using the policy name.
}

type EventData

type EventData struct {
	Q           []dns.Question
	A           []dns.RR
	Type        string
	FirstName   string
	FirstAnswer string
	Local       string
	Remote      string
	Categories  []string
	Timestamp   time.Time
}

type JsonLog

type JsonLog struct {
	SQL *pgxpool.Pool

	IFDB        influxdb2.Client
	IFDB_org    string
	IFDB_bucket string
	Next        plugin.Handler
	// contains filtered or unexported fields
}

JsonLog is the plugin.

func New

func New() *JsonLog

func (*JsonLog) IPQueryHistory

func (plugin *JsonLog) IPQueryHistory(w http.ResponseWriter, r *http.Request)

func (*JsonLog) Name

func (plugin *JsonLog) Name() string

func (*JsonLog) PushEvent

func (plugin *JsonLog) PushEvent(event *DNSEvent)

func (*JsonLog) ServeDNS

func (plugin *JsonLog) ServeDNS(ctx context.Context, rw dns.ResponseWriter, r *dns.Msg) (c int, err error)

func (*JsonLog) String

func (plugin *JsonLog) String() string

type SPRLogConfig

type SPRLogConfig struct {
	HostPrivacyIPList []string //list of local IPs to ignore for logs
	DomainIgnoreList  []string //list of local IPs to ignore for logs
	StoreLocalMemory  bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址