Documentation ¶
Index ¶
- Constants
- Variables
- func NewGrok(match string, patternPaths []string, ignoreBlank bool, ...) *grok
- func NewGrokAction(args []string, extra cfg.CommonCfg) (*grokAction, error)
- func RegisterAction(name string, f Factory)
- type Action
- type Add
- type Config
- type ConfigAction
- type ConvertStr
- type Copy
- type Del
- type DropEvent
- type Factory
- type Fmt
- type FmtKey
- type FmtKeyExtra
- type Instance
- type JsonDecode
- type JsonEncode
- type Move
- type Print
- type Regex
- type Return
- type Set
- type Split
- type SplitExtra
- type StrConvert
- type Timestamp
- type UnderRoot
Constants ¶
View Source
const ( AddName = "add" AddUsageMsg = "usage: add(key, value)" )
View Source
const ( CopyName = "copy" CopyUsageMsg = "usage: copy(from, to)" )
View Source
const ( DelName = "del" DelUsageMsg = "usage: del(key1, key2...)" )
View Source
const ( DropEventName = "dropEvent" DropEventUsageMsg = "usage: dropEvent()" )
View Source
const ( FmtName = "fmt" FmtUsageMsg = "usage: fmt(key)" )
View Source
const ( FmtKeyName = "fmtKey" FmtKeyUsageMsg = "usage: fmtKey()" )
View Source
const ( JsonDecodeName = "jsonDecode" JsonDecodeUsageMsg = "usage: jsonDecode(key) or jsonDecode(key, to)" )
View Source
const ( JsonEncodeName = "jsonEncode" JsonEncodeUsageMsg = "usage: jsonEncode(key) or jsonEncode(key, to)" )
View Source
const ( MoveName = "move" MoveUsageMsg = "usage: move(from, to)" )
View Source
const ( PrintName = "print" PrintUsageMsg = "usage: print()" )
View Source
const ( RegexName = "regex" RegexUsageMsg = "usage: regex(key) or regex(key, to)" )
View Source
const ( ReturnName = "return" ReturnUsageMsg = "usage: return()" )
View Source
const ( SetName = "set" SetUsageMsg = "usage: set(key, value)" )
View Source
const ( SplitName = "split" SplitUsageMsg = "usage: split(key) or split(key, to)" )
View Source
const ( StrConvertName = "strconv" StrConvertUsageMsg = "usage: strconv(key, type)" )
View Source
const ( TimestampName = "timestamp" TimestampUsageMsg = "usage: timestamp(key)" LayoutUnix = "unix" LayoutUnixMs = "unix_ms" )
View Source
const ( ToStrName = "toStr" ToStrUsageMsg = "usage: toStr(key) or toStr(key, srcType)" )
View Source
const ( UnderRootName = "underRoot" UnderRootUsageMsg = "usage: underRoot(key)" )
View Source
const (
HeaderRoot = "_root"
)
Variables ¶
View Source
var DefaultgrokPattern = map[string]string{
"USERNAME": "[a-zA-Z0-9._-]+",
"USER": "%{USERNAME}",
"INT": "(?:[+-]?(?:[0-9]+))",
"WORD": "\\b\\w+\\b",
"UUID": "[A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}",
"IPV4": "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",
"PATH": "(?:%{UNIXPATH}|%{WINPATH})",
"UNIXPATH": "(/[\\w_%!$@:.,-]?/?)(\\S+)?",
"WINPATH": "([A-Za-z]:|\\\\)(?:\\\\[^\\\\?*]*)+",
"MONTHNUM": "(?:0?[1-9]|1[0-2])",
"MONTHDAY": "(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9])",
"YEAR": "(\\d\\d){1,2}",
"DATE_US": "%{MONTHNUM}[/-]%{MONTHDAY}[/-]%{YEAR}",
"DATE_EU": "%{MONTHDAY}[./-]%{MONTHNUM}[./-]%{YEAR}",
"DATE_CN": "%{YEAR}[./-]%{MONTHNUM}[./-]%{MONTHDAY}",
"DATE": "%{DATE_US}|%{DATE_EU}|%{DATE_CN}",
"HOUR": "(?:2[0123]|[01]?[0-9])",
"MINUTE": "(?:[0-5][0-9])",
"SECOND": "(?:(?:[0-5][0-9]|60)(?:[:.,][0-9]+)?)",
"TIME": "([^0-9]?)%{HOUR}:%{MINUTE}(?::%{SECOND})([^0-9]?)",
"DATESTAMP": "%{DATE}[- ]%{TIME}",
}
View Source
var ErrorDropEvent = errors.New("DROP_EVENT")
View Source
var ErrorReturn = errors.New("RETURN")
Functions ¶
func NewGrokAction ¶ added in v1.4.0
func RegisterAction ¶
Types ¶
type Config ¶
func (*Config) ToActionCfg ¶
func (c *Config) ToActionCfg() (*ConfigAction, error)
type ConfigAction ¶
type ConvertStr ¶ added in v1.5.0
type ConvertStr struct {
// contains filtered or unexported fields
}
func NewConvertStr ¶ added in v1.5.0
func NewConvertStr(args []string) (*ConvertStr, error)
type FmtKeyExtra ¶
type Instance ¶
type Instance struct { Name string Action Config ConfigAction }
type JsonDecode ¶
type JsonDecode struct {
// contains filtered or unexported fields
}
func NewJsonDecode ¶
func NewJsonDecode(args []string) (*JsonDecode, error)
type JsonEncode ¶ added in v1.4.0
type JsonEncode struct {
// contains filtered or unexported fields
}
func NewJsonEncode ¶ added in v1.4.0
func NewJsonEncode(args []string) (*JsonEncode, error)
type SplitExtra ¶ added in v1.4.0
type StrConvert ¶
type StrConvert struct {
// contains filtered or unexported fields
}
func NewStrConvert ¶
func NewStrConvert(args []string) (*StrConvert, error)
Click to show internal directories.
Click to hide internal directories.