The current existing telegraf is controlled by systemctl.
I tried to add one more input : logparser.
When I restarted the telegraf with systemctl restart telegraf. The logparser is loaded but it doesn’t work. The data is not loaded into influxdb. I tried to comment out everything except the logparser part. It doesn’t work either.
However if I started another telegraf instance on the same box using telegraf --config telegraf_logparser.conf it works. The data is loaded into Influxdb.
I compared the two configuration files. There is no difference. I don’t understand why the systemctl one
doesn’t work.
Is any reason behind this? I want to start only one telegraf instance.
Thank you for your quick response.
Below is the output from telegraf --test. It seems that logparser is not supported in test mode.
2019-04-25T23:22:12Z W!: [agent] skipping plugin [[inputs.http_listener]]: service inputs not supported in --test mode
2019-04-25T23:22:12Z W!: [agent] skipping plugin [[inputs.logparser]]: service inputs not supported in --test mode
My guess is that this is related to the service running as the telegraf user and when you run it manually it runs as who you are logged in as. Try checking the permissions on the file you are following.