Skip to content

Commit

Permalink
Use kebab_case in the settings for the JSON processor
Browse files Browse the repository at this point in the history
This is to align them with the rest of our configuration files.
  • Loading branch information
Tudor Golubenco committed Dec 4, 2016
1 parent cf4855c commit afad0ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ https://github.com/elastic/beats/compare/v5.1.1...5.1[Check the HEAD diff]

*Affecting all Beats*

- Renamed the following settings of the decode_json_fields processor: maxDepth to max_depth and processArray to process_array. {pull}3111[3111]

*Metricbeat*

*Packetbeat*
Expand Down
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 afad0ac

Please sign in to comment.