drop

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PacketDropLogTimeLayout = "2006-01-02T15:04:05.000000-07:00"

Variables

This section is empty.

Functions

func RunParsing

func RunParsing(logPrefix string, logChangeCh <-chan string, packetDropCh chan<- PacketDrop)

Parse the logs from given channel and insert objects of PacketDrop as parsing result to another channel

Types

type PacketDrop

type PacketDrop struct {
	LogTime  string
	HostName string
	SrcIP    string
	DstIP    string
}

PacketDrop is the result object parsed from single raw log containing information about an iptables packet drop.

func (PacketDrop) GetLogTime

func (pd PacketDrop) GetLogTime() (time.Time, error)

Get the time object of PacketDrop log time

func (PacketDrop) IsExpired

func (pd PacketDrop) IsExpired() bool

Check if PacketDrop is expired

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher handles detecting any changes on the given file and passing those changes through Go Channel to be parsed.

func InitWatcher

func InitWatcher(watchFileName string, watchInterval time.Duration) *Watcher

Init a watcher object and return its pointer

func (*Watcher) Run

func (watcher *Watcher) Run(logChangeCh chan<- string)

Run the watcher and insert newly found logs into given channel

Jump to

Keyboard shortcuts

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