|
5 | 5 | "time" |
6 | 6 |
|
7 | 7 | "github.com/influxdata/telegraf" |
8 | | - |
9 | 8 | "github.com/influxdata/telegraf/plugins/parsers/collectd" |
10 | 9 | "github.com/influxdata/telegraf/plugins/parsers/csv" |
11 | 10 | "github.com/influxdata/telegraf/plugins/parsers/dropwizard" |
@@ -61,69 +60,69 @@ type Parser interface { |
61 | 60 | // and can be used to instantiate _any_ of the parsers. |
62 | 61 | type Config struct { |
63 | 62 | // Dataformat can be one of: json, influx, graphite, value, nagios |
64 | | - DataFormat string |
| 63 | + DataFormat string `toml:"data_format"` |
65 | 64 |
|
66 | 65 | // Separator only applied to Graphite data. |
67 | | - Separator string |
| 66 | + Separator string `toml:"separator"` |
68 | 67 | // Templates only apply to Graphite data. |
69 | | - Templates []string |
| 68 | + Templates []string `toml:"templates"` |
70 | 69 |
|
71 | 70 | // TagKeys only apply to JSON data |
72 | | - TagKeys []string |
| 71 | + TagKeys []string `toml:"tag_keys"` |
73 | 72 | // FieldKeys only apply to JSON |
74 | | - JSONStringFields []string |
| 73 | + JSONStringFields []string `toml:"json_string_fields"` |
75 | 74 |
|
76 | | - JSONNameKey string |
| 75 | + JSONNameKey string `toml:"json_name_key"` |
77 | 76 | // MetricName applies to JSON & value. This will be the name of the measurement. |
78 | | - MetricName string |
| 77 | + MetricName string `toml:"metric_name"` |
79 | 78 |
|
80 | 79 | // holds a gjson path for json parser |
81 | | - JSONQuery string |
| 80 | + JSONQuery string `toml:"json_query"` |
82 | 81 |
|
83 | 82 | // key of time |
84 | | - JSONTimeKey string |
| 83 | + JSONTimeKey string `toml:"json_time_key"` |
85 | 84 |
|
86 | 85 | // time format |
87 | | - JSONTimeFormat string |
| 86 | + JSONTimeFormat string `toml:"json_time_format"` |
88 | 87 |
|
89 | 88 | // Authentication file for collectd |
90 | | - CollectdAuthFile string |
| 89 | + CollectdAuthFile string `toml:"collectd_auth_file"` |
91 | 90 | // One of none (default), sign, or encrypt |
92 | | - CollectdSecurityLevel string |
| 91 | + CollectdSecurityLevel string `toml:"collectd_security_level"` |
93 | 92 | // Dataset specification for collectd |
94 | | - CollectdTypesDB []string |
| 93 | + CollectdTypesDB []string `toml:"collectd_types_db"` |
95 | 94 |
|
96 | 95 | // whether to split or join multivalue metrics |
97 | | - CollectdSplit string |
| 96 | + CollectdSplit string `toml:"collectd_split"` |
98 | 97 |
|
99 | 98 | // DataType only applies to value, this will be the type to parse value to |
100 | | - DataType string |
| 99 | + DataType string `toml:"data_type"` |
101 | 100 |
|
102 | 101 | // DefaultTags are the default tags that will be added to all parsed metrics. |
103 | | - DefaultTags map[string]string |
| 102 | + DefaultTags map[string]string `toml:"default_tags"` |
104 | 103 |
|
105 | 104 | // an optional json path containing the metric registry object |
106 | 105 | // if left empty, the whole json object is parsed as a metric registry |
107 | | - DropwizardMetricRegistryPath string |
| 106 | + DropwizardMetricRegistryPath string `toml:"dropwizard_metric_registry_path"` |
108 | 107 | // an optional json path containing the default time of the metrics |
109 | 108 | // if left empty, the processing time is used |
110 | | - DropwizardTimePath string |
| 109 | + DropwizardTimePath string `toml:"dropwizard_time_path"` |
111 | 110 | // time format to use for parsing the time field |
112 | 111 | // defaults to time.RFC3339 |
113 | | - DropwizardTimeFormat string |
| 112 | + DropwizardTimeFormat string `toml:"dropwizard_time_format"` |
114 | 113 | // an optional json path pointing to a json object with tag key/value pairs |
115 | 114 | // takes precedence over DropwizardTagPathsMap |
116 | | - DropwizardTagsPath string |
| 115 | + DropwizardTagsPath string `toml:"dropwizard_tags_path"` |
117 | 116 | // an optional map containing tag names as keys and json paths to retrieve the tag values from as values |
118 | 117 | // used if TagsPath is empty or doesn't return any tags |
119 | | - DropwizardTagPathsMap map[string]string |
| 118 | + DropwizardTagPathsMap map[string]string `toml:"dropwizard_tag_paths_map"` |
120 | 119 |
|
121 | 120 | //grok patterns |
122 | | - GrokPatterns []string |
123 | | - GrokNamedPatterns []string |
124 | | - GrokCustomPatterns string |
125 | | - GrokCustomPatternFiles []string |
126 | | - GrokTimezone string |
| 121 | + GrokPatterns []string `toml:"grok_patterns"` |
| 122 | + GrokNamedPatterns []string `toml:"grok_named_patterns"` |
| 123 | + GrokCustomPatterns string `toml:"grok_custom_patterns"` |
| 124 | + GrokCustomPatternFiles []string `toml:"grok_custom_pattern_files"` |
| 125 | + GrokTimezone string `toml:"grok_timezone"` |
127 | 126 |
|
128 | 127 | //csv configuration |
129 | 128 | CSVColumnNames []string `toml:"csv_column_names"` |
|
0 commit comments