Closed vboehm closed 1 year ago
Many thanks!
I have also amended this line
else:
if type(val) == str:
- val = val.replace(' ', '\ ').replace(',', '\,').replace('=', '\=')
+ val = identifier2lineprotocol(val)
When trying to save and restore the
InfluxDB
data for myHomeAssistant
instance I ran into some errors:You can replace the slash in the filename by another charachter (U+2044 FRACTION SLASH,
U+2215 DIVISION SLASH, U+2571 is BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT etc.) or a sequence of characters ('<@>', '=>' or what you like).
I preferred the U+2571 solution and fixed it in this way.
Since it is allowed to use Blank (' '), comma (',') and equal sign ('=') in tag keys and field keys and blanks and commas in measurements (see InfluxDB documentation), these characters must also be escaped. Until now (commit #166779d) only values are escaped.
I fixed this also.
latin1
character set, the build of the write request failed. When thedata
parameter torequests.post()
is a string it will be converted to the standard HTTP character setlatin1
which fails for non-latin1 characters.When this parameter is of type
bytes
no conversion takes place and everything works fine.This issue is also fixed.
The 1st and 3rd flaw were already mentioned in the issues #3 and #6.
I hope these changes make this nice program a little bit more usable :-)
Volker Böhm (volker@vboehm.de)
P.S.: I have a working copy of the changes in my git repository but I don't know how to put it into a pull request on GitHub.
I attached the updated file
influx-backup.py
asinflux-backup.txt
since the bloodyGitHub
does not accept PY-files :-( influx-backup .txt