Snmp input regex conversion help

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:
agents = [ “” ]
community = “public”
name = “snmp”
version = 1
retries = 3
timeout = “10s”

  name = "Temp Intern iTi"
  oid = "."

namepass = [“snmp”]
key = “Temp Intern iTi”
pattern = “^\s*(\d{1,3}\.\d)" replacement = "{1}”
result_key = “temp”

output of telegraf test:

snmp,agent_host=, 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

The telegraf --test command doesn’t run the processors, it’s something I’ve been meaning to change but never get the time. I usually debug this by adding a file output writing to stdout and then run Telegraf for a bit with only the plugins of interest, this way I avoid writing unwanted data to my database:

telegraf --input-filter=snmp --output-filter=file

I believe your regular expression will match, but you might also consider using the strings + converter plugin and switching the temperature to a float, this way you could do comparison operations:

  order = 1
  namepass = ["snmp"]
    field = "Temp Intern iTi"

  order = 2
  namepass = ["snmp"]
    float = ["Temp Intern iTi"]

hi daniel,
ist working!
thanks good master!! :smile: