collect_list

package
v1.300031.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FiltersSectionKey           = "filters"
	FiltersTypeSectionKey       = "type"
	FiltersExpressionSectionKey = "expression"
)
View Source
const AutoRemovalSectionKey = "auto_removal"
View Source
const BlacklistSectionKey = "blacklist"
View Source
const EncodingSectionKey = "encoding"
View Source
const LogGroupNameSectionKey = "log_group_name"
View Source
const PublishMultiLogsSectionKey = "publish_multi_logs"
View Source
const RetentionInDaysSectionKey = "retention_in_days"
View Source
const (
	SectionKey = "collect_list"
)

Variables

View Source
var ChildRule = map[string][]Rule{}
View Source
var Index = 0
View Source
var MergeRuleMap = map[string]mergeJsonRule.MergeRule{}
View Source
var TimeFormatMap = map[string]string{
	"%B":  "January",
	"%b":  "Jan",
	"%-m": "1",
	"%m":  "01",
	"%A":  "Monday",
	"%a":  "Mon",
	"%-d": "_2",
	"%d":  "_2",
	"%H":  "15",
	"%-I": "3",
	"%I":  "03",
	"%-M": "4",
	"%M":  "04",
	"%-S": "5",
	"%S":  "05",
	"%Y":  "2006",
	"%y":  "06",
	"%p":  "PM",
	"%Z":  "MST",
	"%z":  "-0700",
	"%f":  ".000",
}

The reference time used in the layouts in Golang is the specific time. For example : "Mon Jan 2 15:04:05 MST 2006"

So the TimeFormatMap records time_format code and its corresponding Golang specific reference time. And the TimeFormatRexMap records time_format code and its corresponding regax expression. When process the user's input, the translator will translate the timestamp_format into the Golang reference time layout and the regax expression based on those two maps.

Based on https://golang.org/src/time/format.go and http://strftime.org/, here is the mapping below: stdLongMonth // "January" //%B stdMonth // "Jan" //%b stdNumMonth // "1" //%-m stdZeroMonth // "01" //%m stdLongWeekDay // "Monday" //%A stdWeekDay // "Mon" //%a stdDay // "2" //%-d stdUnderDay // "_2" // stdZeroDay // "02" //%d stdHour // "15" //%H stdHour12 // "3" //%-I stdZeroHour12 // "03" //%I stdMinute // "4" //%-M stdZeroMinute // "04" //%M stdSecond // "5" //%-S stdZeroSecond // "05" //%S stdLongYear // "2006" //%Y stdYear // "06" //%y stdPM // "PM" //%p stdpm // "pm" // stdTZ // "MST" //%Z stdISO8601TZ // "Z0700" // prints Z for UTC stdISO8601SecondsTZ // "Z070000" stdISO8601ShortTZ // "Z07" stdISO8601ColonTZ // "Z07:00" // prints Z for UTC stdISO8601ColonSecondsTZ // "Z07:00:00" stdNumTZ // "-0700" // always numeric //%z stdNumSecondsTz // "-070000" stdNumShortTZ // "-07" // always numeric stdNumColonTZ // "-07:00" // always numeric stdNumColonSecondsTZ // "-07:00:00" stdFracSecond0 // ".0", ".00", ... , trailing zeros included stdFracSecond9 // ".9", ".99", ..., trailing zeros omitted

View Source
var TimeFormatRegexEscapeMap = map[string]string{
	"^": "\\^",
	".": "\\.",
	"*": "\\*",
	"?": "\\?",
	"|": "\\|",
	"[": "\\[",
	"]": "\\]",
	"(": "\\(",
	")": "\\)",
	"{": "\\{",
	"}": "\\}",
	"$": "\\$",
}

The characters required to be escaped are these characters special in regex, but normal in json. Characters are special in regex: ^ . * ? + - \ | [ ] ( ) { } $ + is already part of the timestamp format - is not required to be escaped when not inside []. \ is already required to be escaped in json too. The remaining characters are: ^ . * ? | [ ] ( ) { } $

View Source
var TimeFormatRexMap = map[string]string{
	"%B":  "\\w{7}",
	"%b":  "\\w{3}",
	"%-m": "\\s{0,1}\\d{1,2}",
	"%m":  "\\s{0,1}\\d{1,2}",
	"%A":  "\\w{6,9}",
	"%a":  "\\w{3}",
	"%-d": "\\s{0,1}\\d{1,2}",
	"%d":  "\\s{0,1}\\d{1,2}",
	"%H":  "\\d{2}",
	"%-I": "\\d{1,2}",
	"%I":  "\\d{2}",
	"%-M": "\\d{1,2}",
	"%M":  "\\d{2}",
	"%-S": "\\d{1,2}",
	"%S":  "\\d{2}",
	"%Y":  "\\d{4}",
	"%y":  "\\d{2}",
	"%p":  "\\w{2}",
	"%Z":  "\\w{3}",
	"%z":  "[\\+-]\\d{4}",
	"%f":  "(\\d{1,9})",
}

Functions

func GetCurPath

func GetCurPath() string

func RegisterRule

func RegisterRule(fieldname string, r []Rule)

Types

type AutoRemoval

type AutoRemoval struct {
}

func (*AutoRemoval) ApplyRule

func (r *AutoRemoval) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type BlackList

type BlackList struct {
}

func (*BlackList) ApplyRule

func (f *BlackList) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type Encoding

type Encoding struct {
}

func (*Encoding) ApplyRule

func (e *Encoding) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type FileConfig

type FileConfig struct {
}

func (*FileConfig) ApplyRule

func (f *FileConfig) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

func (*FileConfig) Merge

func (f *FileConfig) Merge(source map[string]interface{}, result map[string]interface{})

type FilePath

type FilePath struct {
}

func (*FilePath) ApplyRule

func (f *FilePath) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type FromBeginning

type FromBeginning struct {
}

func (*FromBeginning) ApplyRule

func (f *FromBeginning) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type LogConfig

type LogConfig struct {
	LogGroupName string `json:"log_group_name"`
}

type LogFilter added in v1.247350.0

type LogFilter struct {
}

func (*LogFilter) ApplyRule added in v1.247350.0

func (lf *LogFilter) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type LogGroupName

type LogGroupName struct {
}

func (*LogGroupName) ApplyRule

func (l *LogGroupName) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type LogStreamName

type LogStreamName struct {
}

func (*LogStreamName) ApplyRule

func (l *LogStreamName) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type MultiLineStartPattern

type MultiLineStartPattern struct {
}

func (*MultiLineStartPattern) ApplyRule

func (m *MultiLineStartPattern) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type OutputLogConfigFile

type OutputLogConfigFile struct {
	Version    string      `json:"version"`
	LogConfigs []LogConfig `json:"log_configs"`
	Region     string      `json:"region"`
}

type Pipe

type Pipe struct {
}

func (*Pipe) ApplyRule

func (p *Pipe) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type PublishMultiLogs

type PublishMultiLogs struct {
}

func (*PublishMultiLogs) ApplyRule

func (l *PublishMultiLogs) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type RetentionInDays added in v1.247350.0

type RetentionInDays struct {
}

func (*RetentionInDays) ApplyRule added in v1.247350.0

func (f *RetentionInDays) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

type Rule

type Rule translator.Rule

type TimestampLayout

type TimestampLayout struct {
}

func (*TimestampLayout) ApplyRule

func (t *TimestampLayout) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

ApplyRule add timestamp layout do not add timestamp check when viewing cwa logfile

type TimestampRegex added in v1.300030.0

type TimestampRegex struct {
}

func (*TimestampRegex) ApplyRule added in v1.300030.0

func (t *TimestampRegex) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

ApplyRule add timestamp regex do not add timestamp check when viewing cwa logfile

type Timezone

type Timezone struct {
}

func (*Timezone) ApplyRule

func (t *Timezone) ApplyRule(input interface{}) (returnKey string, returnVal interface{})

Jump to

Keyboard shortcuts

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