Flattening of the json to push the data in InflluxDB and have a option to skip flattening if it is not required.
Install the Influxdb using the link and start the server as mentioned in the article.
-
Install the go binary.
-
Include the following lines in the $HOME/.profile file
export GOPATH=$HOME/go export PATH=/usr/local/go/bin:$GOPATH/bin:$GOPATH/bin/golint
-
Install the influxdb go client library using the following commands
export INFLUXDB_GO_PATH=${GOPATH}/src/github.com/influxdata/influxdb mkdir -p ${INFLUXDB_GO_PATH} && \ git clone https://github.com/influxdata/influxdb ${INFLUXDB_GO_PATH} && \ cd ${INFLUXDB_GO_PATH} && \ git checkout -b v1.6.0 tags/v1.6.0
-
Use the following command to run the go example,
go run influx_flat_json.go
-
Install the influxdb python library using the following command.
pip3 install influxdb
-
To run the python example,
python3 influx_flat_json.py