Skip to content

Commit 4a9b08a

Browse files
Fix non-windows fields on system/filesystem (#21758)
* fix windows fields on system/filesystem * add changelog * fix tests
1 parent 3f57f0e commit 4a9b08a

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
371371
- Add a switch to the driver definition on SQL module to use pretty names {pull}17378[17378]
372372
- Fix retrieving resources by ID for the azure module. {pull}21711[21711] {issue}21707[21707]
373373
- Use timestamp from CloudWatch API when creating events. {pull}21498[21498]
374+
- Report the correct windows events for system/filesystem {pull}21758[21758]
374375

375376
*Packetbeat*
376377

metricbeat/module/system/filesystem/helper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ func GetFilesystemEvent(fsStat *FSStat) common.MapStr {
151151
"mount_point": fsStat.Mount,
152152
"total": fsStat.Total,
153153
"available": fsStat.Avail,
154-
"files": fsStat.Files,
154+
"free": fsStat.Free,
155155
"used": common.MapStr{
156156
"pct": fsStat.UsedPercent,
157157
"bytes": fsStat.Used,
158158
},
159159
}
160160
if runtime.GOOS != "windows" {
161-
evt.Put("free", fsStat.Free)
161+
evt.Put("files", fsStat.Files)
162162
evt.Put("free_files", fsStat.FreeFiles)
163163
}
164164
return evt

metricbeat/module/system/test_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"free_files", "mount_point", "total", "used.bytes",
4848
"used.pct"]
4949

50-
SYSTEM_FILESYSTEM_FIELDS_WINDOWS = ["available", "device_name", "type", "files",
50+
SYSTEM_FILESYSTEM_FIELDS_WINDOWS = ["available", "device_name", "type", "free",
5151
"mount_point", "total", "used.bytes",
5252
"used.pct"]
5353

0 commit comments

Comments
 (0)