From 7845d4a4669b868d067867bdf1dc3820d9ab6b84 Mon Sep 17 00:00:00 2001 From: Max U Date: Tue, 26 Jun 2018 11:26:43 -0700 Subject: [PATCH] docker will spin up --- internal/config/config.go | 9 --------- plugins/inputs/reader/dev/docker-compse.yml | 13 ------------- plugins/inputs/reader/dev/telegraf.conf | 10 +++++----- plugins/inputs/reader/reader.go | 2 +- 4 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 plugins/inputs/reader/dev/docker-compse.yml diff --git a/internal/config/config.go b/internal/config/config.go index 845b0b92c..1a98c61c5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1393,14 +1393,6 @@ func buildParser(name string, tbl *ast.Table) (parsers.Parser, error) { c.MetricName = name - if node, ok := tbl.Fields["name_override"]; ok { - if kv, ok := node.(*ast.KeyValue); ok { - if str, ok := kv.Value.(*ast.String); ok { - c.MetricName = str.Value - } - } - } - delete(tbl.Fields, "data_format") delete(tbl.Fields, "separator") delete(tbl.Fields, "templates") @@ -1419,7 +1411,6 @@ func buildParser(name string, tbl *ast.Table) (parsers.Parser, error) { delete(tbl.Fields, "custom_patterns") delete(tbl.Fields, "custom_pattern_files") delete(tbl.Fields, "timezone") - delete(tbl.Fields, "name_override") return parsers.NewParser(c) } diff --git a/plugins/inputs/reader/dev/docker-compse.yml b/plugins/inputs/reader/dev/docker-compse.yml deleted file mode 100644 index a5abde8ac..000000000 --- a/plugins/inputs/reader/dev/docker-compse.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '3' - -# services: - telegraf: - image: glinton/scratch - volumes: - - ./telegraf.conf:/telegraf.conf - - ../../../../telegraf:/telegraf - - ./test.log:/var/log/test.log - entrypoint: - - /telegraf - - --config - - /telegraf.conf \ No newline at end of file diff --git a/plugins/inputs/reader/dev/telegraf.conf b/plugins/inputs/reader/dev/telegraf.conf index 971845682..76f57f0ad 100644 --- a/plugins/inputs/reader/dev/telegraf.conf +++ b/plugins/inputs/reader/dev/telegraf.conf @@ -69,22 +69,22 @@ # ## /var/log/**.log -> recursively find all .log files in /var/log # ## /var/log/*/*.log -> find all .log files with a parent dir in /var/log # ## /var/log/apache.log -> only tail the apache log file -files = ["/Users/maxu/go/src/github.com/influxdata/telegraf/plugins/inputs/reader/testfiles/grok_a.log"] +files = ["/var/log/test.log"] # # ## The dataformat to be read from files # ## Each data format has its own unique set of configuration options, read # ## more about them here: # ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md -data_format = "grok" +data_format = "json" # -patterns = ["%{COMMON_LOG_FORMAT}"] +#patterns = ["%{TEST_LOG_B}","%{TEST_LOG_A}"] # # ## Name of the outputted measurement name. -measurement = "grok_reader" +#name_override = "grok_reader" # # ## Full path(s) to custom pattern files. -# custom_pattern_files = [] +#custom_pattern_files = ["/Users/maxu/go/src/github.com/influxdata/telegraf/plugins/inputs/logparser/grok/testdata/test-patterns"] # # ## Custom patterns can also be defined here. Put one pattern per line. # custom_patterns = ''' diff --git a/plugins/inputs/reader/reader.go b/plugins/inputs/reader/reader.go index eb2ce4804..e21295611 100644 --- a/plugins/inputs/reader/reader.go +++ b/plugins/inputs/reader/reader.go @@ -18,7 +18,7 @@ type Reader struct { Filenames []string } -const sampleConfig = `## Files to parse. +const sampleConfig = `## Files to parse each interval. ## These accept standard unix glob matching rules, but with the addition of ## ** as a "super asterisk". ie: ## /var/log/**.log -> recursively find all .log files in /var/log