Quiq / influxdb-tools

InfluxDB Tools
Apache License 2.0
51 stars 25 forks source link

Fixing some issues on special characters in names an non latin1 characters in names and values #10

Closed vboehm closed 1 year ago

vboehm commented 2 years ago

When trying to save and restore the InfluxDB data for my HomeAssistant instance I ran into some errors:

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 as influx-backup.txt since the bloody GitHub does not accept PY-files :-( influx-backup .txt

roman-vynar commented 2 years ago

Many thanks!

I have also amended this line

                     else:
                         if type(val) == str:
-                            val = val.replace(' ', '\ ').replace(',', '\,').replace('=', '\=')
+                            val = identifier2lineprotocol(val)
roman-vynar commented 2 years ago

Pushed as https://github.com/Quiq/influxdb-tools/commit/3789263524dd9cd23a78203e4957c932c93c8b6f