From 95edfcbf99c3d012b5a18bf9134000a3122f9890 Mon Sep 17 00:00:00 2001 From: Max U Date: Mon, 25 Jun 2018 10:15:32 -0700 Subject: [PATCH] add init function to reader --- plugins/inputs/reader/reader.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/inputs/reader/reader.go b/plugins/inputs/reader/reader.go index 504a40b3a..853405745 100644 --- a/plugins/inputs/reader/reader.go +++ b/plugins/inputs/reader/reader.go @@ -6,6 +6,7 @@ import ( "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/internal/globpath" + "github.com/influxdata/telegraf/plugins/inputs" "github.com/influxdata/telegraf/plugins/parsers" ) @@ -154,3 +155,9 @@ func (r *Reader) readMetric(filename string) ([]telegraf.Metric, error) { return r.Parser.Parse(fileContents) } + +func init() { + inputs.Add("reader", func() telegraf.Input { + return &Reader{} + }) +}