Skip to content

Commit

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

* add changelog

* fix tests

(cherry picked from commit 4a9b08a)
  • Loading branch information
fearful-symmetry authored Oct 14, 2020
1 parent 07aa2ec commit eebe220
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 @@ -415,6 +415,7 @@ field. You can revert this change by configuring tags for the module and omittin
- Fix remote_write flaky test. {pull}21173[21173]
- Visualization title fixes in aws, azure and googlecloud compute dashboards. {pull}21098[21098]
- 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 eebe220

Please sign in to comment.