以下是我的电报配置:
[[inputs.file]]
files = ["/home/chengxun/applog/LogstashPOC.log"]
character_encoding = "utf-8"
data_format = "json"
我尝试输出到 influxdb_v2,输出是正确的,因为我保留了电报现有的指标,如 cpu、内存,并且它们发送到 influxdb 成功。
以下是我的 json 日志文件内容(我使用官方示例作为日志文件)
{"a": 51,"b": {"c": 61},"ignored": "I'm a string"}
{"a": 51,"b": {"c": 61},"ignored": "I'm a string"}
{"a": 51,"b": {"c": 61},"ignored": "I'm a string"}
.... // many the same lines here
{"a": 51,"b": {"c": 61},"ignored": "I'm a string"}
{"a": 51,"b": {"c": 61},"ignored": "I'm a string"}
{"a": 51,"b": {"c": 61},"ignored": "I'm a string"}
但是电报日志告诉我:
2021-12-12T14:37:21Z E! [inputs.file] Error in plugin: invalid character '{' after top-level value