Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/griesbacher/influxdb_dumper
Dumps tables from InfluxDB to files in the InfluxDB lineformat. These files can later be imported by Nagflux or directly send by curl to the InfluxDB.
https://github.com/griesbacher/influxdb_dumper
Last synced: about 1 month ago
JSON representation
Dumps tables from InfluxDB to files in the InfluxDB lineformat. These files can later be imported by Nagflux or directly send by curl to the InfluxDB.
- Host: GitHub
- URL: https://github.com/griesbacher/influxdb_dumper
- Owner: Griesbacher
- License: gpl-2.0
- Created: 2016-01-08T13:32:14.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-12T10:16:19.000Z (almost 9 years ago)
- Last Synced: 2023-03-02T14:46:33.157Z (almost 2 years ago)
- Language: Python
- Size: 16.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InfluxDB Dumper
Dumps tables from InfluxDB to files in the InfluxDB lineformat. These files can later be imported by Nagflux or directly send by curl to the InfluxDB.**This file should work with Python 2 and 3.**
## Usage
```
usage: dumper.py [-h] [--url URL] [--file FILE] [--target TARGET]
[tablenames [tablenames ...]]Dumps Tables from InfluxDB and writes them to files
positional arguments:
tablenames List of tabelnamesoptional arguments:
-h, --help show this help message and exit
--url URL URL to the InfluxDB with username, password... Default:
http://127.0.0.1:8086/query?db=mydb
--file FILE File with tablenames, one tablename per line
--target TARGET Target folder. Default: dump
```
### Get tablenames
``` bash
$ influx -database mydb -execute 'show series' | grep "name: " | cut -c 7-
```
Store them in a file and pass the filepath with --file to the dumper.### Example
``` bash
$ influx -database mydb -execute 'show series' | grep "name: " | cut -c 7- > influx_list
$ python dumper.py --file influx_list --url 'http://InfluxDB:8086/query?db=mydb'
```
There should be a folder called dump, within on file per table.Or dump just a few tables:
``` bash
$ python dumper.py --url 'http://InfluxDB:8086/query?db=mydb' 'mySpecialTable1' 'mySpecialTable2'
```