hello people, i get “Error in plugin: invalid character ‘c’ looking for beginning of value” while lunching my telegraf config, i’m new + clueless
additional data:
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.7.10
Telegraf 1.32.0
terminal output:
inputs.mqtt_consumer] Connected [tcp://*****:1883]
2024-10-11T23:24:43Z W! [inputs.mqtt_consumer] No metrics were created from a message. Verify your parser settings. This message is only printed once.2024-10-11T23:24:43Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ‘c’ looking for beginning of value
.
my mqtt json published data:
msg send {“msg”:“Hello”,“device_id”:1234567890,“inputA”:328,“inputB”:1176,“inputC”:663,“inputD”:100,“inputE”:24,“inputF”:-40,“inputG”:1,“inputH”:-5,“protocol”:“tcp”,“date”:“2024-10-12 01:15:42”}
my config json output in --test:
> test,device_id=1234567890,topic=test inputA=3.28,inputB=11.76,inputC=6.63,inputD=1,inputE=0.24,inputF=-0.4,inputG=0.01,inputH=-0.05 1728688592706516650
my config:
in other topic
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 2500 #1000
metric_buffer_limit = 100000 #10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
hostname = ""
omit_hostname = true
[[inputs.mqtt_consumer]]
servers = ["tcp://****:1883"]
topics = ["emqx/#"]
username = "****"
password = "****"
client_id = "*****"
data_format = "json"
tag_keys = ["device_id"]
qos = 0
[[processors.regex]]
[[processors.regex.tags]]
key = "topic"
pattern = "^emqx/(.*)$"
replacement = "${1}"
[[processors.converter]]
[processors.converter.fields]
float = ["inputA", "inputB", "inputC", "inputD", "inputE", "inputF", "inputG", "inputH"]
[[processors.starlark]]
source = '''
def apply(metric):
for field in ["inputA", "inputB", "inputC", "inputD", "inputE", "inputF", "inputG", "inputH"]:
if field in metric.fields:
metric.fields[field] = float(metric.fields[field]) / 100 # Remove this line to keep original values
metric.name = metric.tags["topic"]
return metric
'''
[[outputs.influxdb_v2]]
urls = ["http://*******:8086"]
token = "*****"
organization = "****"
bucket = "test"
timeout = "5s"