loglerpart

package
v0.0.0-...-28787c5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnablePsFlag          = 0
	Get_ps_from_file_flag = 1 // from ps_base_rule.json (file) or rules.go
	MaxPsCount            = 8000

	PsCount       = make(map[string]int)
	PsByteCount   = make(map[string]int)
	PsByteSqCount = make(map[string]int)
	PsExlog       = make(map[string]string)

	PsListAll PsListType
	Ps2Pnode  = make(map[string]string)

	LogLineCount           = 0
	MaxLogLineCount        = 50000
	StopCh                 = make(chan int)
	PsmodCmd        string = ""
	LogiqctlVersion string = "<un-tracked>"
)

Functions

func CheckPsmod

func CheckPsmod()

func DumpCurrentPsList

func DumpCurrentPsList(fout string)

DumpCurrentPsList Open JSON and read base rules

func DumpCurrentPsStat

func DumpCurrentPsStat(fout string)

func DumpsPsInfo

func DumpsPsInfo()

func EscOff

func EscOff(b []byte) []byte

EscOff convert escape char to char

func GetPsListFile

func GetPsListFile(fin string)

GetPsListFile get PsList from file

func GetPsmodVersion

func GetPsmodVersion() string

func IncLogLineCount

func IncLogLineCount()

func Init

func Init(vv string)

func InitPaths

func InitPaths()

func MyChkError

func MyChkError(err error,
	mesg string,
	ExitFlag int)

MyChkError check error and exit

func MyJSONChkError

func MyJSONChkError(err error,
	mesg string,
	ExitFlag int)

MyJSONChkError check error and exit, not working

func MyOkCheck

func MyOkCheck(ok bool,
	mesg string,
	ExitFlag int)

MyOkCheck takes ok bool and print mesg and exit depending on input

func ProcessLogCmd

func ProcessLogCmd(pp string) string

func PsCheckAndReturnTag

func PsCheckAndReturnTag(PsItem string, mesg string) string

PsCheckAndReturnTag takes a LogPs returns pnode tag. if PsItem is not in the list, create new entry and update list

func SetupCloseHandler

func SetupCloseHandler()

Types

type MyError

type MyError struct{}

MyError dummy for custom erro:

func (*MyError) Error

func (m *MyError) Error() string

type Pair

type Pair struct {
	Key   string
	Value int
}

type PairList

type PairList []Pair

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type PsListType

type PsListType struct {
	DateTime         string            `json:"datetime"`
	PsNodeCnt        int               `json:"pnode_cnt"`
	PsNodeCntComment string            `json:"pnode_cnt_comment"`
	PsListComment    string            `json:"ps_list_comment"`
	PsList           map[string]string `json:"ps_list"`
}

PsListType list current PS tag

Jump to

Keyboard shortcuts

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