From b723587e2695626d5929e875496898b5c024051f Mon Sep 17 00:00:00 2001 From: Alex K <8418476+fearful-symmetry@users.noreply.github.com> Date: Wed, 14 Oct 2020 07:49:01 -0700 Subject: [PATCH] Fix non-windows fields on system/filesystem (#21758) * fix windows fields on system/filesystem * add changelog * fix tests (cherry picked from commit 4a9b08ae2c67dd9d9631f76e88cf55af54aa3587) --- CHANGELOG.next.asciidoc | 1 + metricbeat/module/system/filesystem/helper.go | 4 ++-- metricbeat/module/system/test_system.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index d942faa20c09..0f39a38b8b60 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -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* diff --git a/metricbeat/module/system/filesystem/helper.go b/metricbeat/module/system/filesystem/helper.go index 4d53ddf2a79e..9238df79f594 100644 --- a/metricbeat/module/system/filesystem/helper.go +++ b/metricbeat/module/system/filesystem/helper.go @@ -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 diff --git a/metricbeat/module/system/test_system.py b/metricbeat/module/system/test_system.py index 0cfb820c18ac..2e1b9e579d94 100644 --- a/metricbeat/module/system/test_system.py +++ b/metricbeat/module/system/test_system.py @@ -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"]