Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix toml option names in parser processor #5218

Merged
merged 1 commit into from
Jan 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 26 additions & 27 deletions plugins/parsers/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"`
Expand Down