From c3bab78ea8e04fdb11810a23509153d2309c935c Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 3 Oct 2018 12:58:21 -0700 Subject: [PATCH] Fix case of timezone/grok_timezone options. (#4799) --- internal/config/config.go | 2 +- plugins/inputs/logparser/logparser.go | 4 ++-- plugins/parsers/registry.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 3d0510978..4382e0cbe 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1442,7 +1442,7 @@ func getParserConfig(name string, tbl *ast.Table) (*parsers.Config, error) { if node, ok := tbl.Fields["grok_timezone"]; ok { if kv, ok := node.(*ast.KeyValue); ok { if str, ok := kv.Value.(*ast.String); ok { - c.GrokTimeZone = str.Value + c.GrokTimezone = str.Value } } } diff --git a/plugins/inputs/logparser/logparser.go b/plugins/inputs/logparser/logparser.go index d52df3aa9..089c22d94 100644 --- a/plugins/inputs/logparser/logparser.go +++ b/plugins/inputs/logparser/logparser.go @@ -27,7 +27,7 @@ type GrokConfig struct { NamedPatterns []string CustomPatterns string CustomPatternFiles []string - TimeZone string + Timezone string } type logEntry struct { @@ -137,7 +137,7 @@ func (l *LogParserPlugin) Start(acc telegraf.Accumulator) error { GrokNamedPatterns: l.GrokConfig.NamedPatterns, GrokCustomPatterns: l.GrokConfig.CustomPatterns, GrokCustomPatternFiles: l.GrokConfig.CustomPatternFiles, - GrokTimeZone: l.GrokConfig.TimeZone, + GrokTimezone: l.GrokConfig.Timezone, DataFormat: "grok", } diff --git a/plugins/parsers/registry.go b/plugins/parsers/registry.go index c662cf300..8f972fb1b 100644 --- a/plugins/parsers/registry.go +++ b/plugins/parsers/registry.go @@ -123,7 +123,7 @@ type Config struct { GrokNamedPatterns []string GrokCustomPatterns string GrokCustomPatternFiles []string - GrokTimeZone string + GrokTimezone string //csv configuration CSVColumnNames []string `toml:"csv_column_names"` @@ -185,7 +185,7 @@ func NewParser(config *Config) (Parser, error) { config.GrokNamedPatterns, config.GrokCustomPatterns, config.GrokCustomPatternFiles, - config.GrokTimeZone) + config.GrokTimezone) case "csv": parser, err = newCSVParser(config.MetricName, config.CSVHeaderRowCount,