Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use snake_case in the settings for the JSON processor #3111

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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