It looks like you're writing Python. Your code will be easier to read if you 
use string formatting[1] rather than concatenating multiple calls.

Print out the result of data. You'll see that it's not valid line protocol 
because your fields are separated by spaces when they should be separated by 
commas.

[1] 
https://stackoverflow.com/questions/5082452/python-string-formatting-vs-format
 
On Tuesday, October 11, 2016 at 9:11:29 AM UTC-7, [email protected] wrote:
> I am trying to post data to influxdb from data that I'm receiving from Kafka. 
> 
> I have extracted the fields from my JSON messages and stored them in 
> variables. I am trying to post these variables to InfluxDB. However I keep 
> getting a "bad time stamp" error. I am unsure of what i am doing wrong. Any 
> input would be appreciated.
> 
> I have included the details below:
> 
> url = 'http://localhost:8086/write?db=mydb'
>     headers = {'Content-Type': 'application/x-www-form-urlencoded'}
>     data='series_name,device=devicename,interface='+str(interface)+' 
> value='+str(value)+' typeof='+str(typeof)+' '+str(time)+'\n'
>     r=requests.post(url, data=data,headers=headers)
> 
> Here, interface, value and timeoff are JSON extracted values.

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/13581ff0-3bbe-4dac-89ca-4c40c520b079%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to