2018-07-14 06:22:59 +00:00
|
|
|
# File Input Plugin
|
|
|
|
|
|
|
|
The file plugin updates a list of files every interval and parses the contents
|
|
|
|
using the selected [input data format](/docs/DATA_FORMATS_INPUT.md).
|
|
|
|
|
|
|
|
Files will always be read in their entirety, if you wish to tail/follow a file
|
|
|
|
use the [tail input plugin](/plugins/inputs/tail) instead.
|
|
|
|
|
|
|
|
### Configuration:
|
2019-11-13 21:00:41 +00:00
|
|
|
|
2018-07-14 06:22:59 +00:00
|
|
|
```toml
|
|
|
|
[[inputs.file]]
|
|
|
|
## Files to parse each interval.
|
|
|
|
## These accept standard unix glob matching rules, but with the addition of
|
|
|
|
## ** as a "super asterisk". ie:
|
|
|
|
## /var/log/**.log -> recursively find all .log files in /var/log
|
|
|
|
## /var/log/*/*.log -> find all .log files with a parent dir in /var/log
|
2018-08-17 20:45:22 +00:00
|
|
|
## /var/log/apache.log -> only read the apache log file
|
2018-07-14 06:22:59 +00:00
|
|
|
files = ["/var/log/apache/access.log"]
|
|
|
|
|
|
|
|
## Data format to consume.
|
|
|
|
## Each data format has its own unique set of configuration options, read
|
|
|
|
## more about them here:
|
|
|
|
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
|
|
|
data_format = "influx"
|
2019-11-13 21:00:41 +00:00
|
|
|
|
|
|
|
## Name a tag containing the name of the file the data was parsed from. Leave empty
|
|
|
|
## to disable.
|
|
|
|
# file_tag = ""
|
2018-07-14 06:22:59 +00:00
|
|
|
```
|