influxdata / influxdata/telegraf

[input.file] Limit read data

Open
#18,137 8 comments 0 reactions 1 assignee Claimed by @srebhan View on GitHub
bug
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Relevant telegraf.conf

```toml
[[inputs.filestat]]
files = ["/tmp/test.log"]
```

### Logs from Telegraf

```text
2025-12-16T16:34:53Z I! [outputs.prometheus_client] Listening on https://0.0.0.0:4493/metrics
2025-12-16T16:35:55Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s
2025-12-16T16:36:26Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s
2025-12-16T16:36:57Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s
2025-12-16T16:37:28Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s
```

### System info

Telegraf 1.37.0

### Docker

RAS

### Steps to reproduce

1. Add file supervision
2. Put big content in file (for example 1.7 Go)
3. CPU used by agent is very height

### Expected behavior

It will be greate to be abble to limit read size of file content to protect agent.

### Actual behavior

Agent never read all content of file and use a lot of CPU.

### Additional info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.