-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
@@ -49,3 +49,7 @@ func WriteJSONKeys(event common.MapStr, keys map[string]interface{}, overwriteKe | |||
|
|||
} | |||
} | |||
|
|||
func CreateJSONError(message string) common.MapStr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have to be exported? Seems simple enough to replicate if we need it elsewhere, similar to the debug
function calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported function CreateJSONError should have comment or be unexported
PR added, function duplicated and golint errors fixed. |
jenkins, retest it |
e480942
to
840e1e7
Compare
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
comment on exported function WriteJSONKeys should be of the form "WriteJSONKeys ..."
a578ca5
to
183e793
Compare
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.
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 toerror.message
anderror.type: json
. This makes it easy to search for all json errors. This is a breaking change.The naming of the config option was not touched for better backward compatibility.