I am using InfluxDb and have simple line protocol line as shown below:
cpu,atag=test1 idle=100,usertime=10,system=1
I have python client using dictionary as shown below
client = InfluxDBClient(host, port, USER, PASSWORD, DBNAME)
client.create_database(DBNAME)
tagdic= {'Name': 'n1', 'data': 7}
fielddic= {'Name': 'field', 'f1': 70}
def main():
var = 1
while var == 1 :
client.write("cpu,atag=test1 idle=100,usertime=10,system=1")
#client.write_points([{"measurement": "cpu", "tags": tagdic, "fields": fielddic}])
Above program is working fine as long as I am using write_points using write_points and dictionary, but when i am using client.write i am getting errors.
How can i use client.write as mention here (line number -255) by using protocol value = 'line' instead of default protocol 'json'?