forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed redis.index option to redis.key
The "index" setting name has historical reasons, from the times that all outputs shared the same configuration options. Since the meaning and contents of the "index" setting are starting to vary per output, it's time to clean this up. The Redis "index" is now called "key". Before this change, the index was still somehow special, since it was set to the beatName outside of the output. This removes this hack, and sets index to beatName only in the Elasticsearch and Logstash modules. This also removes the `index` setting for the file output, but that was never documented. Part of elastic#2074.
- Loading branch information
Tudor Golubenco
committed
Jul 21, 2016
1 parent
2e761cd
commit e83d6a1
Showing
15 changed files
with
96 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package redis | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestValidate(t *testing.T) { | ||
type io struct { | ||
Name string | ||
Input redisConfig | ||
Valid bool | ||
} | ||
|
||
tests := []io{ | ||
io{"No config", redisConfig{Key: "", Index: ""}, true}, | ||
io{"Only key", redisConfig{Key: "test", Index: ""}, true}, | ||
io{"Only index", redisConfig{Key: "", Index: "test"}, true}, | ||
io{"Both", redisConfig{Key: "test", Index: "test"}, false}, | ||
|
||
io{"Invalid Datatype", redisConfig{Key: "test", DataType: "something"}, false}, | ||
io{"List Datatype", redisConfig{Key: "test", DataType: "list"}, true}, | ||
io{"Channel Datatype", redisConfig{Key: "test", DataType: "channel"}, true}, | ||
} | ||
|
||
for _, test := range tests { | ||
assert.Equal(t, test.Input.Validate() == nil, test.Valid, test.Name) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.