MCPcopy
hub / github.com/influxdata/telegraf / Parser

Struct Parser

plugins/parsers/grok/parser.go:71–91  ·  view source on GitHub ↗

Parser is the primary struct to handle and grok-patterns defined in the config toml

Source from the content-addressed store, hash-verified

69
70// Parser is the primary struct to handle and grok-patterns defined in the config toml
71type Parser struct {
72 Patterns []string `toml:"grok_patterns"`
73 NamedPatterns []string `toml:"grok_named_patterns"`
74 CustomPatterns string `toml:"grok_custom_patterns"`
75 CustomPatternFiles []string `toml:"grok_custom_pattern_files"`
76 Multiline bool `toml:"grok_multiline"`
77 Timezone string `toml:"grok_timezone"`
78 UniqueTimestamp string `toml:"grok_unique_timestamp"`
79 Measurement string `toml:"-"`
80 DefaultTags map[string]string `toml:"-"`
81 Log telegraf.Logger `toml:"-"`
82
83 loc *time.Location
84 typeMap map[string]map[string]string
85 tsMap map[string]map[string]string
86 patternsMap map[string]string
87 foundTSLayouts []string
88 g *grok.Grok
89 tsModder *tsModder
90 timeFunc func() time.Time
91}
92
93func (p *Parser) Init() error {
94 if len(p.Patterns) == 0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected