Skip to content

Commit

Permalink
Fix non-windows fields on system/filesystem (#21758)
Browse files Browse the repository at this point in the history
* fix windows fields on system/filesystem

* add changelog

* fix tests
  • Loading branch information
fearful-symmetry committed Oct 14, 2020
1 parent 3f57f0e commit 4a9b08a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add a switch to the driver definition on SQL module to use pretty names {pull}17378[17378]
- Fix retrieving resources by ID for the azure module. {pull}21711[21711] {issue}21707[21707]
- Use timestamp from CloudWatch API when creating events. {pull}21498[21498]
- Report the correct windows events for system/filesystem {pull}21758[21758]

*Packetbeat*

Expand Down
4 changes: 2 additions & 2 deletions metricbeat/module/system/filesystem/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ func GetFilesystemEvent(fsStat *FSStat) common.MapStr {
"mount_point": fsStat.Mount,
"total": fsStat.Total,
"available": fsStat.Avail,
"files": fsStat.Files,
"free": fsStat.Free,
"used": common.MapStr{
"pct": fsStat.UsedPercent,
"bytes": fsStat.Used,
},
}
if runtime.GOOS != "windows" {
evt.Put("free", fsStat.Free)
evt.Put("files", fsStat.Files)
evt.Put("free_files", fsStat.FreeFiles)
}
return evt
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"free_files", "mount_point", "total", "used.bytes",
"used.pct"]

SYSTEM_FILESYSTEM_FIELDS_WINDOWS = ["available", "device_name", "type", "files",
SYSTEM_FILESYSTEM_FIELDS_WINDOWS = ["available", "device_name", "type", "free",
"mount_point", "total", "used.bytes",
"used.pct"]

Expand Down

0 comments on commit 4a9b08a

Please sign in to comment.