jsonlog

package module
v0.0.0-...-57f731e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: BSD-3-Clause Imports: 20 Imported by: 0

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 EventData

type EventData struct {
	Q           []dns.Question
	A           []dns.RR
	Type        string
	FirstName   string
	FirstAnswer string
	Local       string
	Remote      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