From 7ff96a7424b5589775cfa2f681b180da91ad1e1b Mon Sep 17 00:00:00 2001 From: Steven Soroka Date: Wed, 16 Dec 2020 17:04:54 -0500 Subject: [PATCH] Revert "Update grok package to support for field names containing '-' and '.' (#8276)" This reverts commit a5f3121f6d07977d0ea47cae360c0a989c9142ab. (cherry picked from commit 5c826e8a3254dc509012d018638a2e5f41a110f2) --- CHANGELOG.md | 1 - go.mod | 2 +- go.sum | 4 ++-- plugins/parsers/grok/parser_test.go | 19 ------------------- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 921ccf977..6bcf0a36a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ - [#8499](https://github.com/influxdata/telegraf/pull/8499) `processors.execd` Adding support for new lines in influx line protocol fields. - [#8254](https://github.com/influxdata/telegraf/pull/8254) `serializers.carbon2` Fix carbon2 tests - [#8498](https://github.com/influxdata/telegraf/pull/8498) `inputs.http_response` fixed network test - - [#8276](https://github.com/influxdata/telegraf/pull/8276) `parsers.grok` Update grok package to support for field names containing '-' and '.' - [#8414](https://github.com/influxdata/telegraf/pull/8414) `inputs.bcache` Fix tests for Windows - part 1 - [#8577](https://github.com/influxdata/telegraf/pull/8577) `inputs.ping` fix potential issue with race condition - [#8562](https://github.com/influxdata/telegraf/pull/8562) `inputs.mqtt_consumer` fix issue with mqtt concurrent map write diff --git a/go.mod b/go.mod index d222ff34e..d0da1c151 100644 --- a/go.mod +++ b/go.mod @@ -126,7 +126,7 @@ require ( github.com/tidwall/gjson v1.6.0 github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e // indirect github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc // indirect - github.com/vjeantet/grok v1.0.1-0.20180213041522-5a86c829f3c3 + github.com/vjeantet/grok v1.0.0 github.com/vmware/govmomi v0.19.0 github.com/wavefronthq/wavefront-sdk-go v0.9.2 github.com/wvanbergen/kafka v0.0.0-20171203153745-e2edea948ddf diff --git a/go.sum b/go.sum index 4aaf5103c..a0d9277dc 100644 --- a/go.sum +++ b/go.sum @@ -597,8 +597,8 @@ github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e h1:f1yevOHP+Su github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc h1:R83G5ikgLMxrBvLh22JhdfI8K6YXEPHx5P03Uu3DRs4= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vjeantet/grok v1.0.1-0.20180213041522-5a86c829f3c3 h1:T3ATR84Xk4b9g0QbGgLJVpRYWm/jvixqLTWRsR108sI= -github.com/vjeantet/grok v1.0.1-0.20180213041522-5a86c829f3c3/go.mod h1:/FWYEVYekkm+2VjcFmO9PufDU5FgXHUz9oy2EGqmQBo= +github.com/vjeantet/grok v1.0.0 h1:uxMqatJP6MOFXsj6C1tZBnqqAThQEeqnizUZ48gSJQQ= +github.com/vjeantet/grok v1.0.0/go.mod h1:/FWYEVYekkm+2VjcFmO9PufDU5FgXHUz9oy2EGqmQBo= github.com/vmware/govmomi v0.19.0 h1:CR6tEByWCPOnRoRyhLzuHaU+6o2ybF3qufNRWS/MGrY= github.com/vmware/govmomi v0.19.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/wavefronthq/wavefront-sdk-go v0.9.2 h1:/LvWgZYNjHFUg+ZUX+qv+7e+M8sEMi0lM15zPp681Gk= diff --git a/plugins/parsers/grok/parser_test.go b/plugins/parsers/grok/parser_test.go index 5aaa0c967..1c409e8a5 100644 --- a/plugins/parsers/grok/parser_test.go +++ b/plugins/parsers/grok/parser_test.go @@ -1115,22 +1115,3 @@ func TestTrimRegression(t *testing.T) { ) require.Equal(t, expected, actual) } - -func TestAdvanceFieldName(t *testing.T) { - p := &Parser{ - Patterns: []string{`rts=%{NUMBER:response-time.s} local=%{IP:local-ip} remote=%{IP:remote.ip}`}, - } - assert.NoError(t, p.Compile()) - - metricA, err := p.ParseLine(`rts=1.283 local=127.0.0.1 remote=10.0.0.1`) - require.NotNil(t, metricA) - assert.NoError(t, err) - assert.Equal(t, - map[string]interface{}{ - "response-time.s": "1.283", - "local-ip": "127.0.0.1", - "remote.ip": "10.0.0.1", - }, - metricA.Fields()) - assert.Equal(t, map[string]string{}, metricA.Tags()) -}