add init function to reader

This commit is contained in:
Max U 2018-06-25 10:15:32 -07:00
parent 36a23ea1ba
commit f40371e361
1 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/influxdata/telegraf" "github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal/globpath" "github.com/influxdata/telegraf/internal/globpath"
"github.com/influxdata/telegraf/plugins/inputs"
"github.com/influxdata/telegraf/plugins/parsers" "github.com/influxdata/telegraf/plugins/parsers"
) )
@ -154,3 +155,9 @@ func (r *Reader) readMetric(filename string) ([]telegraf.Metric, error) {
return r.Parser.Parse(fileContents) return r.Parser.Parse(fileContents)
} }
func init() {
inputs.Add("reader", func() telegraf.Input {
return &Reader{}
})
}