2019-01-22 22:12:41 +00:00
|
|
|
# Filecount Input Plugin
|
2018-07-31 22:05:55 +00:00
|
|
|
|
|
|
|
Counts files in directories that match certain criteria.
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[[inputs.filecount]]
|
|
|
|
## Directory to gather stats about.
|
2018-12-13 20:25:49 +00:00
|
|
|
## deprecated in 1.9; use the directories option
|
2018-07-31 22:05:55 +00:00
|
|
|
directory = "/var/cache/apt/archives"
|
|
|
|
|
2018-12-13 20:25:49 +00:00
|
|
|
## Directories to gather stats about.
|
|
|
|
## This accept standard unit glob matching rules, but with the addition of
|
|
|
|
## ** as a "super asterisk". ie:
|
|
|
|
## /var/log/** -> recursively find all directories in /var/log and count files in each directories
|
|
|
|
## /var/log/*/* -> find all directories with a parent dir in /var/log and count files in each directories
|
|
|
|
## /var/log -> count all files in /var/log and all of its subdirectories
|
|
|
|
directories = ["/var/cache/apt/archives"]
|
|
|
|
|
2018-07-31 22:05:55 +00:00
|
|
|
## Only count files that match the name pattern. Defaults to "*".
|
|
|
|
name = "*.deb"
|
|
|
|
|
|
|
|
## Count files in subdirectories. Defaults to true.
|
|
|
|
recursive = false
|
|
|
|
|
|
|
|
## Only count regular files. Defaults to true.
|
|
|
|
regular_only = true
|
|
|
|
|
2018-10-19 18:17:18 +00:00
|
|
|
## Only count files that are at least this size. If size is
|
2018-07-31 22:05:55 +00:00
|
|
|
## a negative number, only count files that are smaller than the
|
2018-10-19 18:17:18 +00:00
|
|
|
## absolute value of size. Acceptable units are B, KiB, MiB, KB, ...
|
|
|
|
## Without quotes and units, interpreted as size in bytes.
|
|
|
|
size = "0B"
|
2018-07-31 22:05:55 +00:00
|
|
|
|
|
|
|
## Only count files that have not been touched for at least this
|
|
|
|
## duration. If mtime is negative, only count files that have been
|
|
|
|
## touched in this duration. Defaults to "0s".
|
|
|
|
mtime = "0s"
|
|
|
|
```
|
|
|
|
|
2019-01-22 22:12:41 +00:00
|
|
|
### Metrics
|
2018-07-31 22:05:55 +00:00
|
|
|
|
|
|
|
- filecount
|
2019-01-22 22:12:41 +00:00
|
|
|
- tags:
|
2018-12-13 20:25:49 +00:00
|
|
|
- directory (the directory path)
|
2019-01-22 22:12:41 +00:00
|
|
|
- fields:
|
|
|
|
- count (integer)
|
|
|
|
- size_bytes (integer)
|
2018-07-31 22:05:55 +00:00
|
|
|
|
|
|
|
### Example Output:
|
|
|
|
|
|
|
|
```
|
2019-01-22 22:12:41 +00:00
|
|
|
filecount,directory=/var/cache/apt count=7i,size_bytes=7438336i 1530034445000000000
|
|
|
|
filecount,directory=/tmp count=17i,size_bytes=28934786i 1530034445000000000
|
2018-07-31 22:05:55 +00:00
|
|
|
```
|