System filesystem metricsetedit

The System filesystem metricset provides file system statistics. For each file system, one document is provided.

This metricset is available on:

  • FreeBSD
  • Linux
  • macOS
  • OpenBSD
  • Windows

Configurationedit

filesystem.ignore_types - A list of filesystem types to ignore. Metrics will not be collected from filesystems matching these types. This setting also affects the fsstats metricset. If this option is not set, metricbeat ignores all types for virtual devices in systems where this information is available (e.g. all types marked as nodev in /proc/filesystems in Linux systems).

Filteringedit

Often there are mounted filesystems that you do not want Metricbeat to report metrics on. One option is to configure Metricbeat to ignore specific filesystem types. This can be accomplished by configuring filesystem.ignore_types with a list of filesystem types to ignore. In this example we are ignoring three types of filesystems.

metricbeat.modules:
  - module: system
    period: 30s
    metricsets: ["filesystem"]
    filesystem.ignore_types: [nfs, smbfs, autofs]

Another strategy to deal with these filesystems is to configure a drop_event processor that matches the mount_point using a regular expression. This type of filtering occurs after the data has been collected so it can be less efficient than the previous method.

metricbeat.modules:
  - module: system
    period: 30s
    metricsets: ["filesystem"]
    processors:
      - drop_event.when.regexp:
          system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host)($|/)'

Fieldsedit

For a description of each field in the metricset, see the exported fields section.

Here is an example document generated by this metricset:

{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "agent": {
        "hostname": "host.example.com",
        "name": "host.example.com"
    },
    "event": {
        "dataset": "system.filesystem",
        "duration": 115000,
        "module": "system"
    },
    "metricset": {
        "name": "filesystem"
    },
    "service": {
        "type": "system"
    },
    "system": {
        "filesystem": {
            "available": 53067177984,
            "device_name": "/dev/dm-5",
            "files": 0,
            "free": 54342492160,
            "free_files": 0,
            "mount_point": "/var/lib/lxd/storage-pools/default",
            "total": 86301999104,
            "type": "btrfs",
            "used": {
                "bytes": 31959506944,
                "pct": 0.3759
            }
        }
    }
}