Update grok version (#2662)

This commit is contained in:
Daniel Nelson 2017-04-12 17:10:17 -07:00 committed by GitHub
parent 49ab4e26f8
commit 3e0c55bff9
2 changed files with 21 additions and 1 deletions

2
Godeps
View File

@ -49,7 +49,7 @@ github.com/shirou/gopsutil dfbb3e40da8d6fcd1aa0d87003e965fe0ca745ea
github.com/soniah/gosnmp 5ad50dc75ab389f8a1c9f8a67d3a1cd85f67ed15
github.com/streadway/amqp 63795daa9a446c920826655f26ba31c81c860fd6
github.com/stretchr/testify 4d4bfba8f1d1027c4fdbe371823030df51419987
github.com/vjeantet/grok 83bfdfdfd1a8146795b28e547a8e3c8b28a466c2
github.com/vjeantet/grok d73e972b60935c7fec0b4ffbc904ed39ecaf7efe
github.com/wvanbergen/kafka bc265fedb9ff5b5c5d3c0fdcef4a819b3523d3ee
github.com/wvanbergen/kazoo-go 968957352185472eacb69215fa3dbfcfdbac1096
github.com/yuin/gopher-lua 66c871e454fcf10251c61bf8eff02d0978cae75a

View File

@ -687,3 +687,23 @@ func TestTsModder_Rollover(t *testing.T) {
}
assert.Equal(t, reftime.Add(time.Nanosecond*1000), modt)
}
func TestShortPatternRegression(t *testing.T) {
p := &Parser{
Patterns: []string{"%{TS_UNIX:timestamp:ts-unix} %{NUMBER:value:int}"},
CustomPatterns: `
TS_UNIX %{DAY} %{MONTH} %{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND} %{TZ} %{YEAR}
`,
}
require.NoError(t, p.Compile())
metric, err := p.ParseLine(`Wed Apr 12 13:10:34 PST 2017 42`)
require.NoError(t, err)
require.NotNil(t, metric)
require.Equal(t,
map[string]interface{}{
"value": int64(42),
},
metric.Fields())
}