我想阅读纯文本文件。为此,我使用尾部输入插件。配置文件是这样的:
[[inputs.tail]]
files =
["/home/nikitalipatov/Programing/Projects/Diploma/TestData/test.txt"]
from_beginning = true
data_format = "influx"
[[outputs.file]]
files = ["stdout",
"/home/nikitalipatov/Programing/Projects/Diploma/TestData/log.text"]
data_format = "influx"
文本文件的内容:
data1
data2
data3
但是当我尝试启动 Telegraf 时,我收到了这种错误:
telegraf[14541]: 2018-05-16T16:46:24Z E! Error in plugin [inputs.tail]: E! Malformed log line in /home/nikitalipatov/Programing/Projects/Diploma/TestData/1.txt: [data1], Error: metric parse error: expected field at offset 5: "data1\n"