Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metricbeat: provide means to exclude non-user file systems for fsstat. #3226

Closed
slalomnut opened this issue Dec 20, 2016 · 5 comments
Closed
Labels

Comments

@slalomnut
Copy link

Unable to exclude file systems (e.g. (cgroup|tmpfs|rootfs|devpts|pstore|configfs|debugfs|mqueue|hugetlbfs|nfsd|sunrpc|binfmt_misc) ) using filters or processors.
This makes it difficult, if not impossible, to track actual used and free disk space. A feature that would be very nice for infrastructure reporting.

@ruflin
Copy link
Contributor

ruflin commented Dec 23, 2016

@slalomnut Can you share some more details on why it was not possible to exclude these?

@slalomnut
Copy link
Author

slalomnut commented Jan 17, 2017

I've tried both processors and filters but not excluding the fact my regex in the metricbeat.yml is incorrect.

 filters:
    - drop_event.when.regexp.mount_point: '^/(sys|cgroup|proc|dev|etc|host|run)($|/)'
    - drop_event.when.regexp.device_name: '^(tmpfs|sunrpc|rootfs)($|/)'
processors:
 - drop_event:
      when:
        regexp:
          system.fsstat:
            equals: '^(cgroup|tmpfs|rootfs|devpts|pstore|configfs|debugfs|mqueue|hugetlbfs|nfsd|sunrpc|/etc/auto.home|binfmt_misc)'

The above returns a value of 34 for fsstat.count. If I test the processor and run df -a |egrep -v '^(cgroup|tmpfs|rootfs|devpts|pstore|configfs|debugfs|mqueue|hugetlbfs|nfsd|sunrpc|/etc/auto.home|binfmt_misc)' |wc -l on the same system, I get 13.

@slalomnut
Copy link
Author

@ruflin
Copy link
Contributor

ruflin commented Jan 19, 2017

Ok, got it. This a feature request to do some filtering on which file systems should be taken into account for the calculations in the fsstat metricset. We could introduce something like:

fsstat.exclude: ["regexp1", "regexp2]

This would solve your problem, right?

For the moment I would recommend you to use filesystem metricset, only send the file systems you need and do the calculations on the elasticsearch side.

@andrewkroh
Copy link
Member

I think this has been implemented with #6819.

There are a set of filesystem types that are filtered by default (all types marked as nodev in /proc/filesystems in Linux systems) and you can specify your own.

https://www.elastic.co/guide/en/beats/metricbeat/6.4/metricbeat-metricset-system-filesystem.html#_configuration_5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants