logscrub

package
v0.1.63 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 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.

Documentation

Overview

Package logscrub cuts IP addresses out of log text that leaves a node (the node journal, agent.proto JournalEntry). The agent cleans before sending and the panel cleans again on intake. Names, versions, times and hashes stay, except in xray's text (Hosts), where a name may be a destination.

Index

Constants

View Source
const (
	// IP replaces an address; IPPort an address with a port (the port too: a client's source port is noise and
	// makes every line unique).
	IP     = "<ip>"
	IPPort = "<ip>:port"
	Host   = "<host>"
)

Variables

View Source
var JournalAttrs = [...]string{
	"inbound", "protocol", "profile", "port", "state", "reason", "code", "backend", "mode", "version",
	"kernel", "iface", "check", "fix", "count", "err", "error",
}

JournalAttrs are the only attribute keys a journal entry carries, on the node and again in the panel (agent.proto JournalEntry).

Functions

func Addrs

func Addrs(s string) string

Addrs replaces every IP address in s by IP, or by IPPort when it carries a port. Unspecified and loopback addresses (0.0.0.0, ::, 127.0.0.1, ::1) are the node's own and stay. Addrs(Addrs(s)) == Addrs(s).

func Clip

func Clip(s string, max int) string

Clip cuts s to at most max bytes on a rune boundary.

func ClipRunes

func ClipRunes(s string, max int) string

ClipRunes cuts s to at most max runes.

func Hosts

func Hosts(s string) string

Hosts replaces every DNS name by Host. For text that may name a destination (xray's), where a lost file or domain name costs less than a site someone visited.

Types

This section is empty.

Jump to

Keyboard shortcuts

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