Parser is the primary struct to handle and grok-patterns defined in the config toml
| 69 | |
| 70 | // Parser is the primary struct to handle and grok-patterns defined in the config toml |
| 71 | type 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 | |
| 93 | func (p *Parser) Init() error { |
| 94 | if len(p.Patterns) == 0 { |
nothing calls this directly
no outgoing calls
no test coverage detected