wlog

package
v0.0.0-...-a4a1dc1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2015 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILENAME_WLOG_PATTERN1     = `[^_]+_wlog_(\d{8}-\d{4})-(\d{8}-\d{4}).log.gz$`
	FILENAME_WLOG_PATTERN2     = `[^_]+_wlog_(\d{8}-\d{4})-Present.log.gz$`
	FILENAME_WLOG_DATE_PATTERN = `20060102-1504`
)
View Source
const (
	PARSE_BATCH_SIZE                 = 100
	PARSE_CONNECTION_POOL            = 15
	MYSQL_ERROR_TOO_MANY_CONNECTIONS = "1040"
	MYSQL_ERROR_DUPLICATE_ENTRY      = "1062"
	MYSQL_ERROR_DEADLOCK             = "1213"
)

Variables

This section is empty.

Functions

func ParseFile

func ParseFile(r io.Reader, fileRow *models.File, dbm *gorp.DbMap) error

func ParseLine

func ParseLine(line string, c chan *WebFilter)

Types

type ParserBatch

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

func (*ParserBatch) ForeignTableGet

func (self *ParserBatch) ForeignTableGet()

func (*ParserBatch) InsertWebFilter

func (self *ParserBatch) InsertWebFilter(wf WebFilter, txn *gorp.Transaction) error

func (*ParserBatch) InsertWebFilterList

func (self *ParserBatch) InsertWebFilterList(list []*WebFilter, c chan<- int)

type WebFilter

type WebFilter struct {
	Date         time.Time
	DateStr      string `log:"date"`
	TimeStr      string `log:"time"`
	Device       string `log:"devname"`
	DeviceSerial string `log:"devid"`
	LogId        int64  `log:"logid"`
	LogType      string `log:"type"`
	LogSubType   string `log:"subtype"`
	LogLevel     string `log:"level"`
	PolicyId     int64  `log:"policyid"`
	SessionId    int64  `log:"sessionid"`
	User         string `log:"user"`
	SourceIP     net.IP
	SourceIPStr  string `log:"srcip"`
	SourceIf     string `log:"srcintf"`
	DestIP       net.IP
	DestIPStr    string `log:"dstip"`
	DestPort     uint16 `log:"dstport"`
	DestIf       string `log:"dstintf"`
	Service      string `log:"service"`
	Hostname     string `log:"hostname"`
	Profile      string `log:"profile"`
	Status       string `log:"status"`
	Url          string `log:"url"`
	TrafficOut   uint64 `log:"sentbyte"`
	TrafficIn    uint64 `log:"rcvdbyte"`
	Message      string `log:"msg"`
	CategoryId   int    `log:"cat"`
	CategoryDesc string `log:"catdesc"`
}

func (*WebFilter) ConvertFields

func (wf *WebFilter) ConvertFields()

type WebFilterCommand

type WebFilterCommand struct {
	Dbm *gorp.DbMap
}

func NewWebFilterCommand

func NewWebFilterCommand(dbm *gorp.DbMap) *WebFilterCommand

func (*WebFilterCommand) Load

func (wfc *WebFilterCommand) Load(cmd *gocli.Command, args []string)

func (*WebFilterCommand) LoadFile

func (wfc *WebFilterCommand) LoadFile(
	fname string,
	dbm *gorp.DbMap) (int64, error)

type WebFilterList

type WebFilterList []WebFilter

Jump to

Keyboard shortcuts

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