Hi There,
I am using latest version of influxDB but however i am facing with the token error. The token is a string value which i copied it from the influxDB UI. Any help to overcome this error would be appreciated.
from influxdb import InfluxDBClient
from datetime import datetime
bucket = "bucket-name"
org = "org-name"
token=("p5DH4KO_BwOP2-GORB4TpO4rTV0KQxrjWSRjH433vhX4pl0GS881hEulPMW4g8mFsvIG6MeEiJQXO65mhaWjsg==")
client = InfluxDBClient("http://localhost:8086", token, org, bucket)
print("InfluxDB injection process started.")
for row in df.iterrows():
influxJson = [
{
"measurement":"abcd123",
"time" : datetime.utcnow().isoformat() + "Z",
"tags": {
'ResiliencyTier':'targetResiliencyTier',
},
"fields": {
columns[0][0] : str(row[1][0]),
client.write_points(influxJson) #writes data to influxdb
print("InfluxDB process DONE.")
output Error:
File "influx.py", line 28, in startProcess
client = InfluxDBClient("http://localhost:8086", token, org, bucket)
File "/Users/peter/Library/Python/3.8/lib/python/site-packages/influxdb/client.py", line 115, in __init__
self.__port = int(port)
ValueError: invalid literal for int() with base 10: 'p5DH4KO_BwOP2-GORB4TpO4rTV0KQxrjWSRjH433vhX4pl0GS881hEulPMW4g8mFsvIG6MeEiJQXO65mhaWjsg=='
Thank You