Fix case of timezone/grok_timezone options. (#4799)
This commit is contained in:
parent
8500d9345f
commit
c3bab78ea8
|
@ -1442,7 +1442,7 @@ func getParserConfig(name string, tbl *ast.Table) (*parsers.Config, error) {
|
||||||
if node, ok := tbl.Fields["grok_timezone"]; ok {
|
if node, ok := tbl.Fields["grok_timezone"]; ok {
|
||||||
if kv, ok := node.(*ast.KeyValue); ok {
|
if kv, ok := node.(*ast.KeyValue); ok {
|
||||||
if str, ok := kv.Value.(*ast.String); ok {
|
if str, ok := kv.Value.(*ast.String); ok {
|
||||||
c.GrokTimeZone = str.Value
|
c.GrokTimezone = str.Value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ type GrokConfig struct {
|
||||||
NamedPatterns []string
|
NamedPatterns []string
|
||||||
CustomPatterns string
|
CustomPatterns string
|
||||||
CustomPatternFiles []string
|
CustomPatternFiles []string
|
||||||
TimeZone string
|
Timezone string
|
||||||
}
|
}
|
||||||
|
|
||||||
type logEntry struct {
|
type logEntry struct {
|
||||||
|
@ -137,7 +137,7 @@ func (l *LogParserPlugin) Start(acc telegraf.Accumulator) error {
|
||||||
GrokNamedPatterns: l.GrokConfig.NamedPatterns,
|
GrokNamedPatterns: l.GrokConfig.NamedPatterns,
|
||||||
GrokCustomPatterns: l.GrokConfig.CustomPatterns,
|
GrokCustomPatterns: l.GrokConfig.CustomPatterns,
|
||||||
GrokCustomPatternFiles: l.GrokConfig.CustomPatternFiles,
|
GrokCustomPatternFiles: l.GrokConfig.CustomPatternFiles,
|
||||||
GrokTimeZone: l.GrokConfig.TimeZone,
|
GrokTimezone: l.GrokConfig.Timezone,
|
||||||
DataFormat: "grok",
|
DataFormat: "grok",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ type Config struct {
|
||||||
GrokNamedPatterns []string
|
GrokNamedPatterns []string
|
||||||
GrokCustomPatterns string
|
GrokCustomPatterns string
|
||||||
GrokCustomPatternFiles []string
|
GrokCustomPatternFiles []string
|
||||||
GrokTimeZone string
|
GrokTimezone string
|
||||||
|
|
||||||
//csv configuration
|
//csv configuration
|
||||||
CSVColumnNames []string `toml:"csv_column_names"`
|
CSVColumnNames []string `toml:"csv_column_names"`
|
||||||
|
@ -185,7 +185,7 @@ func NewParser(config *Config) (Parser, error) {
|
||||||
config.GrokNamedPatterns,
|
config.GrokNamedPatterns,
|
||||||
config.GrokCustomPatterns,
|
config.GrokCustomPatterns,
|
||||||
config.GrokCustomPatternFiles,
|
config.GrokCustomPatternFiles,
|
||||||
config.GrokTimeZone)
|
config.GrokTimezone)
|
||||||
case "csv":
|
case "csv":
|
||||||
parser, err = newCSVParser(config.MetricName,
|
parser, err = newCSVParser(config.MetricName,
|
||||||
config.CSVHeaderRowCount,
|
config.CSVHeaderRowCount,
|
||||||
|
|
Loading…
Reference in New Issue