Skip to content
Snippets Groups Projects
Unverified Commit 402460f0 authored by Daniel Nelson's avatar Daniel Nelson
Browse files

Use underscore as default opentsdb seperator

Preserves backwards compatibility
parent f85db907
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ var ( ...@@ -22,6 +22,7 @@ var (
`%`, "-", `%`, "-",
"#", "-", "#", "-",
"$", "-") "$", "-")
defaultSeperator = "_"
) )
type OpenTSDB struct { type OpenTSDB struct {
...@@ -56,8 +57,8 @@ var sampleConfig = ` ...@@ -56,8 +57,8 @@ var sampleConfig = `
## Debug true - Prints OpenTSDB communication ## Debug true - Prints OpenTSDB communication
debug = false debug = false
## Separator separates measurements ## Separator separates measurement name from field
separator = "." separator = "_"
` `
func ToLineFormat(tags map[string]string) string { func ToLineFormat(tags map[string]string) string {
...@@ -258,6 +259,8 @@ func sanitize(value string) string { ...@@ -258,6 +259,8 @@ func sanitize(value string) string {
func init() { func init() {
outputs.Add("opentsdb", func() telegraf.Output { outputs.Add("opentsdb", func() telegraf.Output {
return &OpenTSDB{} return &OpenTSDB{
Separator: defaultSeperator,
}
}) })
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment