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

Always use absolute path for event and registry #3328

Merged
merged 1 commit into from
Feb 7, 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 @@ -17,6 +17,7 @@ https://github.com/elastic/beats/compare/v5.1.1...master[Check the HEAD diff]
- Change beat generator. Use `$GOPATH/src/github.com/elastic/beats/script/generate.py` to generate a beat. {pull}3452[3452]

*Filebeat*
- Always use absolute path for event and registry. This can lead to issues when relative paths were used before. {pull}3328[3328]

*Heartbeat*

Expand All @@ -38,6 +39,7 @@ https://github.com/elastic/beats/compare/v5.1.1...master[Check the HEAD diff]
- Add `_id`, `_type`, `_index` and `_score` fields in the generated index pattern. {pull}3282[3282]

*Filebeat*
- Always use absolute path for event and registry. {pull}3328[3328]

*Heartbeat*

Expand All @@ -47,7 +49,6 @@ https://github.com/elastic/beats/compare/v5.1.1...master[Check the HEAD diff]

*Packetbeat*


*Winlogbeat*


Expand Down
2 changes: 1 addition & 1 deletion filebeat/_meta/fields.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
type: keyword
required: true
description: >
The file from which the line was read. This field contains the full path to the file.
The file from which the line was read. This field contains the absolute path to the file.
For example: `/var/log/system.log`.

- name: offset
Expand Down
2 changes: 1 addition & 1 deletion filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ type: keyword

required: True

The file from which the line was read. This field contains the full path to the file. For example: `/var/log/system.log`.
The file from which the line was read. This field contains the absolute path to the file. For example: `/var/log/system.log`.


[float]
Expand Down
5 changes: 5 additions & 0 deletions filebeat/prospector/prospector_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ func (p *ProspectorLog) scan() {
default:
}

var err error
path, err = filepath.Abs(path)
if err != nil {
logp.Err("could not fetch abs path for file %s: %s", path, err)
}
logp.Debug("prospector", "Check file for harvesting: %s", path)

// Create new state for comparison
Expand Down