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

Move json_error to error.message and error.type #4167

Merged
merged 1 commit into from May 10, 2017

Conversation

Projects
None yet
3 participants
@ruflin
Collaborator

ruflin commented May 2, 2017

All errors are now under the error namespace. This should also be true for json errors. Currently they are put under json_error. This PR changes it to error.message and error.type: json. This makes it easy to search for all json errors. This is a breaking change.

  • Docs updated
  • Tests updated

The naming of the config option was not touched for better backward compatibility.

@@ -49,3 +49,7 @@ func WriteJSONKeys(event common.MapStr, keys map[string]interface{}, overwriteKe
}
}
func CreateJSONError(message string) common.MapStr {

This comment has been minimized.

@tsg

tsg May 2, 2017

Collaborator

Does this have to be exported? Seems simple enough to replicate if we need it elsewhere, similar to the debug function calls.

This comment has been minimized.

@ruflin

ruflin May 2, 2017

Collaborator

I exported it because I also use it in the json reader. But I can also just copy / paste the code to the json reader.

@tsg

LGTM. See tiny comment and please add PR number to changelog.

@@ -8,35 +8,35 @@ import (
"github.com/elastic/beats/libbeat/logp"
)
func WriteJSONKeys(event common.MapStr, keys map[string]interface{}, overwriteKeys bool, errorKey string) {
func WriteJSONKeys(event common.MapStr, keys map[string]interface{}, overwriteKeys bool) {

This comment has been minimized.

@elasticmachine

elasticmachine May 2, 2017

[golint] reported by reviewdog 🐶
exported function WriteJSONKeys should have comment or be unexported

@@ -49,3 +49,7 @@ func WriteJSONKeys(event common.MapStr, keys map[string]interface{}, overwriteKe
}
}
func CreateJSONError(message string) common.MapStr {

This comment has been minimized.

@elasticmachine

elasticmachine May 2, 2017

[golint] reported by reviewdog 🐶
exported function CreateJSONError should have comment or be unexported

@ruflin

This comment has been minimized.

Collaborator

ruflin commented May 2, 2017

PR added, function duplicated and golint errors fixed.

@ruflin

This comment has been minimized.

Collaborator

ruflin commented May 2, 2017

jenkins, retest it

@@ -8,35 +8,36 @@ import (
"github.com/elastic/beats/libbeat/logp"
)
func WriteJSONKeys(event common.MapStr, keys map[string]interface{}, overwriteKeys bool, errorKey string) {
// WritJSONKeys writes the json keys to the given event based on the overwriteKeys option

This comment has been minimized.

@elasticmachine

elasticmachine May 4, 2017

[golint] reported by reviewdog 🐶
comment on exported function WriteJSONKeys should be of the form "WriteJSONKeys ..."

Move json_error to error.message and error.type
All errors are now under the error namespace. This should also be true for json errors. Currently they are put under `json_error`. This PR changes it to `error.message` and `error.type: json`. This makes it easy to search for all json errors. This is a breaking change.

* Docs updated
* Tests updated

The naming of the config option was not touched for better backward compatibility.

@tsg tsg merged commit 97a549a into elastic:master May 10, 2017

5 of 6 checks passed

codecov/project 63% (-1.05%) compared to 4ff772d
Details
CLA Commit author has signed the CLA
Details
codecov/patch 50% of diff hit (within 100% threshold of 64.05%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
default Build finished.
Details

@tsg tsg referenced this pull request Jul 24, 2017

Closed

Document breaking changes in 6.0 #4737

28 of 28 tasks complete

ramon-garcia added a commit to ramon-garcia/beats that referenced this pull request Dec 5, 2017

Move json_error to error.message and error.type (elastic#4167)
All errors are now under the error namespace. This should also be true for json errors. Currently they are put under `json_error`. This PR changes it to `error.message` and `error.type: json`. This makes it easy to search for all json errors. This is a breaking change.

* Docs updated
* Tests updated

The naming of the config option was not touched for better backward compatibility.

athom added a commit to athom/beats that referenced this pull request Jan 25, 2018

Move json_error to error.message and error.type (elastic#4167)
All errors are now under the error namespace. This should also be true for json errors. Currently they are put under `json_error`. This PR changes it to `error.message` and `error.type: json`. This makes it easy to search for all json errors. This is a breaking change.

* Docs updated
* Tests updated

The naming of the config option was not touched for better backward compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment