You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2024-11-26T02:38:49Z I! Loading config: mytest.conf
2024-11-26T02:38:49Z I! Starting Telegraf 1.33.0-eb2afadc (customized) brought to you by InfluxData the makers of InfluxDB
2024-11-26T02:38:49Z I! Available plugins: 3 inputs, 0 aggregators, 0 processors, 2 parsers, 1 outputs, 0 secret-stores
2024-11-26T02:38:49Z I! Loaded inputs: tail
2024-11-26T02:38:49Z I! Loaded aggregators:
2024-11-26T02:38:49Z I! Loaded processors:
2024-11-26T02:38:49Z I! Loaded secretstores:
2024-11-26T02:38:49Z I! Loaded outputs: http
2024-11-26T02:38:49Z I! Tags enabled: host=WX-C-002TK
2024-11-26T02:38:49Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"WX-C-002TK", Flush Interval:10s
2024-11-26T02:38:49Z D! [agent] Initializing plugins
2024-11-26T02:38:49Z D! [agent] Initializing plugin states
2024-11-26T02:38:49Z D! [agent] Connecting outputs
2024-11-26T02:38:49Z D! [agent] Attempting connection to [outputs.http]
2024-11-26T02:38:49Z D! [agent] Successfully connected to outputs.http
2024-11-26T02:38:49Z D! [agent] Starting service inputs
2024-11-26T02:38:49Z D! [inputs.tail] Tail added for "c:\\tmp\\mytest.log"
2024-11-26T02:38:58Z D! [agent] Stopping service inputs
2024-11-26T02:38:58Z D! [inputs.tail] Tail removed for "c:\\tmp\\mytest.log"
2024-11-26T02:38:58Z D! [agent] Input channel closed
2024-11-26T02:38:58Z I! [agent] Hang on, flushing any cached metrics before shutdown
2024-11-26T02:38:58Z D! [outputs.http] Wrote batch of 30 metrics in 85.5889ms
2024-11-26T02:38:58Z D! [outputs.http] Buffer fullness: 0 / 10000 metrics
2024-11-26T02:38:58Z I! [agent] Stopping running outputs
2024-11-26T02:38:58Z D! [agent] Persisting plugin states
2024-11-26T02:38:58Z D! [agent] Stopped Successfully
System info
Windows 11, Telegraf 1.33.0-eb2afadc (git: master@eb2afadc)
Docker
N/A
Steps to reproduce
set from_beginning = true, set a statefile to persist the plugin state.
Start telegraf with above config and Stop
Start telegraf again. It will send the log from the beginning, regardless of the statefile record. In fact the statefile is also empty. Statefile content: {"0f3361e8c8701c3bbb9ce162820ea26a2211a3ab9bb0443ec6469029cd43fc39":"e30="}
Expected behavior
These two options are able to co-exist. When I set both from_begin and statefile:
If there is a record position in the statefile, it reads from the record position.
If the statefile doesn't exist or there is no record location, it reads from the beginning.
Actual behavior
With from_begin=true set, it doesn't log the statefile. It looks like there's a conflict between these two options.
For the original post
As my test with the latest version, Test2 was fixed, but Test1 was not. And my expectation is still there:
This should be fixed by #16123 in Telegraf 1.32.3, since you were able to test that it is fixed on master I will close this issue for now, feel free to reopen if this isn't the case!
The text was updated successfully, but these errors were encountered:
squ
changed the title
As my test with the latest version, Test2 was fixed, but Test1 was not. And my expectation is still there:
[inputs.tail] Behaviour when from_beginning and statefile coexist is not as expected.
Nov 26, 2024
Relevant telegraf.conf
Logs from Telegraf
System info
Windows 11, Telegraf 1.33.0-eb2afadc (git: master@eb2afadc)
Docker
N/A
Steps to reproduce
Expected behavior
These two options are able to co-exist. When I set both from_begin and statefile:
Actual behavior
With from_begin=true set, it doesn't log the statefile. It looks like there's a conflict between these two options.
For the original post
As my test with the latest version, Test2 was fixed, but Test1 was not. And my expectation is still there:
Originally posted by @squ in #16225 (comment)
The text was updated successfully, but these errors were encountered: