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

Change error to error.message #3987

Merged
merged 1 commit into from
Apr 12, 2017
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
3 changes: 2 additions & 1 deletion CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ https://github.com/elastic/beats/compare/v5.1.1...master[Check the HEAD diff]
- Configuration files must be owned by the user running the beat or by root, and
they must not be writable by others. {pull}3544[3544] {pull}3689[3689]
- Usage of field `_type` is now ignored and hardcoded to `doc`. {pull}3757[3757]
- Change vendor manager from glide to govendor {pull}3851[3851]
- Change vendor manager from glide to govendor. {pull}3851[3851]
- Rename `error` field to `error.message`. {pull}3987[3987]

*Filebeat*
- Always use absolute path for event and registry. This can lead to issues when relative paths were used before. {pull}3328[3328]
Expand Down
31 changes: 31 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,37 @@ type: object
Contains user configurable fields.


[float]
== error Fields

Error fields containing additional info in case of errors.



[float]
=== error.message

type: text

Error message.


[float]
=== error.code

type: long

Error code.


[float]
=== error.type

type: keyword

Error type.


[[exported-fields-cloud]]
== Cloud Provider Metadata Fields

Expand Down
10 changes: 5 additions & 5 deletions filebeat/docs/modules-dev-guide.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ exclude_files: [".gz$"]

You'll find this example in the template file that gets generated automatically
when you run `make create-fileset`. In this example, the `paths` variable is
used to construct the `paths` list for the <<prospector-paths>> option.
used to construct the `paths` list for the <<prospector-paths>> option.

Any template files that you add to the `config/` folder need to generate a valid
Filebeat prospector configuration in YAML format. The options accepted by the
prospector configuration are documented in this
<<configuration-filebeat-options,section>>.

The template files use the templating language defined by the
https://golang.org/pkg/text/template/[Golang standard library].
https://golang.org/pkg/text/template/[Golang standard library].

Here is another example that also configures multiline stitching:

Expand All @@ -192,7 +192,7 @@ variables to dynamically switch between configurations.
[float]
==== ingest/*.json

The `ingest/` folder contains Elasticsearch
The `ingest/` folder contains Elasticsearch
{elasticsearch}/ingest.html[Ingest Node] pipeline configurations. The Ingest
Node pipelines are responsible for parsing the log lines and doing other
manipulations on the data.
Expand All @@ -212,7 +212,7 @@ The generator creates a JSON object similar to this one:
],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand All @@ -221,7 +221,7 @@ The generator creates a JSON object similar to this one:

From here, you would typically add processors to the `processors` array to do
the actual parsing. For details on how to use ingest node processors, see the
{elasticsearch}/ingest-processors.html[ingest node documentation]. In
{elasticsearch}/ingest-processors.html[ingest node documentation]. In
particular, you will likely find the
{elasticsearch}/grok-processor.html[Grok processor] to be useful for parsing.
Here is an example for parsing the Nginx access logs.
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/apache2/access/ingest/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/apache2/error/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/auditd/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"on_failure": [
{
"set": {
"field": "error",
"field": "error.message",
"value": "{{ _ingest.on_failure_message }}"
}
}
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/mysql/error/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/mysql/slowlog/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/nginx/access/ingest/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/nginx/error/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/system/auth/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/system/syslog/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/scripts/module/fileset/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"on_failure" : [{
"set" : {
"field" : "error",
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
Expand Down
14 changes: 0 additions & 14 deletions heartbeat/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,3 @@
description: >
Boolean indicator if monitor could validate the service to be available.

- name: error
type: group
description: >
Reason monitor flagging a service as down.
fields:
- name: type
type: keyword
description: >
Failure type. For example `io` or `validate`.

- name: message
type: text
description: >
Failure description.
54 changes: 31 additions & 23 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,37 @@ type: object
Contains user configurable fields.


[float]
== error Fields

Error fields containing additional info in case of errors.



[float]
=== error.message

type: text

Error message.


[float]
=== error.code

type: long

Error code.


[float]
=== error.type

type: keyword

Error type.


[[exported-fields-cloud]]
== Cloud Provider Metadata Fields

Expand Down Expand Up @@ -325,26 +356,3 @@ required: True
Boolean indicator if monitor could validate the service to be available.


[float]
== error Fields

Reason monitor flagging a service as down.



[float]
=== error.type

type: keyword

Failure type. For example `io` or `validate`.


[float]
=== error.message

type: text

Failure description.


17 changes: 17 additions & 0 deletions libbeat/_meta/fields.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,20 @@
description: >
Contains user configurable fields.

- name: error
type: group
description: >
Error fields containing additional info in case of errors.
fields:
- name: message
type: text
description: >
Error message.
- name: code
type: long
description: >
Error code.
- name: type
type: keyword
description: >
Error type.
31 changes: 31 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,37 @@ type: object
Contains user configurable fields.


[float]
== error Fields

Error fields containing additional info in case of errors.



[float]
=== error.message

type: text

Error message.


[float]
=== error.code

type: long

Error code.


[float]
=== error.type

type: keyword

Error type.


[[exported-fields-ceph]]
== ceph Fields

Expand Down
4 changes: 3 additions & 1 deletion metricbeat/docs/how-metricbeat-works.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ reachable:
"hostname": "host.example.com",
"name": "host.example.com"
},
"error": "Get http://127.0.0.1/server-status?auto: dial tcp 127.0.0.1:80: getsockopt: connection refused",
"error": {
"message": "Get http://127.0.0.1/server-status?auto: dial tcp 127.0.0.1:80: getsockopt: connection refused",
},
"metricset": {
"module": "apache",
"name": "status",
Expand Down
4 changes: 3 additions & 1 deletion metricbeat/mb/module/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ func (b EventBuilder) Build() (common.MapStr, error) {

// Adds error to event in case error happened
if b.fetchErr != nil {
event["error"] = b.fetchErr.Error()
event["error"] = common.MapStr{
"message": b.fetchErr.Error(),
}
}

return event, nil
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/mb/module/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestEventBuilderError(t *testing.T) {
t.Fatal(err)
}

assert.Equal(t, errFetch.Error(), event["error"])
assert.Equal(t, errFetch.Error(), event["error"].(common.MapStr)["message"])
}

func TestEventBuilderNoHost(t *testing.T) {
Expand Down
31 changes: 31 additions & 0 deletions packetbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,37 @@ type: object
Contains user configurable fields.


[float]
== error Fields

Error fields containing additional info in case of errors.



[float]
=== error.message

type: text

Error message.


[float]
=== error.code

type: long

Error code.


[float]
=== error.type

type: keyword

Error type.


[[exported-fields-cassandra]]
== Cassandra Fields

Expand Down
Loading