From 4e357322794bb837789ca970b28941d147fefcf9 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 2 Jan 2019 13:55:59 -0800 Subject: [PATCH] Fix toml option names in parser processor (#5218) --- plugins/parsers/registry.go | 53 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/plugins/parsers/registry.go b/plugins/parsers/registry.go index 8ebb4a713..c6ef8ae1e 100644 --- a/plugins/parsers/registry.go +++ b/plugins/parsers/registry.go @@ -5,7 +5,6 @@ import ( "time" "github.com/influxdata/telegraf" - "github.com/influxdata/telegraf/plugins/parsers/collectd" "github.com/influxdata/telegraf/plugins/parsers/csv" "github.com/influxdata/telegraf/plugins/parsers/dropwizard" @@ -61,69 +60,69 @@ type Parser interface { // and can be used to instantiate _any_ of the parsers. type Config struct { // Dataformat can be one of: json, influx, graphite, value, nagios - DataFormat string + DataFormat string `toml:"data_format"` // Separator only applied to Graphite data. - Separator string + Separator string `toml:"separator"` // Templates only apply to Graphite data. - Templates []string + Templates []string `toml:"templates"` // TagKeys only apply to JSON data - TagKeys []string + TagKeys []string `toml:"tag_keys"` // FieldKeys only apply to JSON - JSONStringFields []string + JSONStringFields []string `toml:"json_string_fields"` - JSONNameKey string + JSONNameKey string `toml:"json_name_key"` // MetricName applies to JSON & value. This will be the name of the measurement. - MetricName string + MetricName string `toml:"metric_name"` // holds a gjson path for json parser - JSONQuery string + JSONQuery string `toml:"json_query"` // key of time - JSONTimeKey string + JSONTimeKey string `toml:"json_time_key"` // time format - JSONTimeFormat string + JSONTimeFormat string `toml:"json_time_format"` // Authentication file for collectd - CollectdAuthFile string + CollectdAuthFile string `toml:"collectd_auth_file"` // One of none (default), sign, or encrypt - CollectdSecurityLevel string + CollectdSecurityLevel string `toml:"collectd_security_level"` // Dataset specification for collectd - CollectdTypesDB []string + CollectdTypesDB []string `toml:"collectd_types_db"` // whether to split or join multivalue metrics - CollectdSplit string + CollectdSplit string `toml:"collectd_split"` // DataType only applies to value, this will be the type to parse value to - DataType string + DataType string `toml:"data_type"` // DefaultTags are the default tags that will be added to all parsed metrics. - DefaultTags map[string]string + DefaultTags map[string]string `toml:"default_tags"` // an optional json path containing the metric registry object // if left empty, the whole json object is parsed as a metric registry - DropwizardMetricRegistryPath string + DropwizardMetricRegistryPath string `toml:"dropwizard_metric_registry_path"` // an optional json path containing the default time of the metrics // if left empty, the processing time is used - DropwizardTimePath string + DropwizardTimePath string `toml:"dropwizard_time_path"` // time format to use for parsing the time field // defaults to time.RFC3339 - DropwizardTimeFormat string + DropwizardTimeFormat string `toml:"dropwizard_time_format"` // an optional json path pointing to a json object with tag key/value pairs // takes precedence over DropwizardTagPathsMap - DropwizardTagsPath string + DropwizardTagsPath string `toml:"dropwizard_tags_path"` // an optional map containing tag names as keys and json paths to retrieve the tag values from as values // used if TagsPath is empty or doesn't return any tags - DropwizardTagPathsMap map[string]string + DropwizardTagPathsMap map[string]string `toml:"dropwizard_tag_paths_map"` //grok patterns - GrokPatterns []string - GrokNamedPatterns []string - GrokCustomPatterns string - GrokCustomPatternFiles []string - GrokTimezone string + GrokPatterns []string `toml:"grok_patterns"` + GrokNamedPatterns []string `toml:"grok_named_patterns"` + GrokCustomPatterns string `toml:"grok_custom_patterns"` + GrokCustomPatternFiles []string `toml:"grok_custom_pattern_files"` + GrokTimezone string `toml:"grok_timezone"` //csv configuration CSVColumnNames []string `toml:"csv_column_names"`