Skip to content

Commit

Permalink
Use kebab_case in the settings for the JSON processor (elastic#3111)
Browse files Browse the repository at this point in the history
This is to align them with the rest of our configuration files.
(cherry picked from commit 79e4bb5)
  • Loading branch information
tsg authored and Tudor Golubenco committed Dec 16, 2016
1 parent 7502f53 commit 6b6fbe4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libbeat/processors/actions/decode_json_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type decodeJSONFields struct {

type config struct {
Fields []string `config:"fields"`
MaxDepth int `config:"maxDepth" validate:"min=1"`
ProcessArray bool `config:"processArray"`
MaxDepth int `config:"max_depth" validate:"min=1"`
ProcessArray bool `config:"process_array"`
}

var (
Expand All @@ -38,7 +38,7 @@ func init() {
processors.RegisterPlugin("decode_json_fields",
configChecked(newDecodeJSONFields,
requireFields("fields"),
allowedFields("fields", "maxDepth", "processArray")))
allowedFields("fields", "max_depth", "process_array")))
}

func newDecodeJSONFields(c common.Config) (processors.Processor, error) {
Expand Down
6 changes: 3 additions & 3 deletions libbeat/processors/actions/decode_json_fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ func TestValidJSONDepthTwo(t *testing.T) {
}

testConfig, _ = common.NewConfigFrom(map[string]interface{}{
"fields": fields,
"processArray": false,
"maxDepth": 2,
"fields": fields,
"process_array": false,
"max_depth": 2,
})

actual := getActualValue(t, testConfig, input)
Expand Down

0 comments on commit 6b6fbe4

Please sign in to comment.