hello,
i am new to telegraf and specially with regex. i pull some temperature data which has whitespaces in front. so i cannot read the data in grafana / Influx correctly as it seems.
for me it seems that i have to Strip the whitespaces to store the data correctly.
but i do not really know…
any help appreciated.
conf file:
[[inputs.snmp]]
agents = [ “192.168.1.102:161” ]
community = “public”
name = “snmp”
version = 1
retries = 3
timeout = “10s”
[[inputs.snmp.field]]
name = "Temp Intern iTi"
oid = ".1.3.6.1.4.1.36791.2.1.6"
[[processors.regex]]
namepass = [“snmp”]
[[processors.regex.fields]]
key = “Temp Intern iTi”
pattern = “^\s*(\d{1,3}\.\d)$”
replacement = “${1}”
result_key = “temp”
output of telegraf test:
snmp,agent_host=192.168.1.102,host=xxx.xxx.xxx.xxx Sensor\ S0_1_V=0,Sensor\ S0_1_Z=13674.359,Sensor\ S0_2_V=0,Sensor\ S0_2_Z=174.189,Temp\ Intern\ iTi=" 29.8" 1563910360000000000