dear All,
i have a telegraf agent woth modbus plugin and i qould like to write the data to mssql server.
I tried to configure the output sql plugin but it fails to write data. i do not understand how configure it to check if table exist or create it and how to map the read value to column.
thi is telegraf file configuration
[[outputs.sql]]
driver="mssql"
timestamp_column = "timestamp"
data_source_name = "sqlserver://sa:xx@xxx.yyy.zzz.kkkk:1433/?database=test&connection+timeout=30
[[inputs.modbus]]
name = "PM5300_SAS"
slave_id = 255
timeout = "2s"
controller = "tcp://10.0.2.103:502"
configuration_type = "register"
holding_registers=[
{ name = "VAB", byte_order = "ABCD",data_type = "FLOAT32-IEEE",scale=1.0, a>
{ name = "VAC", byte_order = "ABCD",data_type = "FLOAT32-IEEE",scale=1.0, a>
{ name = "VBC", byte_order = "ABCD",data_type = "FLOAT32-IEEE",scale=1.0, a>
]
telegraf as created a table but cant write the value on it , the error is
[agent] Error writing to outputs.sql: mssql: Incorrect syntax near ','.
is there somebody can help me?