Skip to content

Instantly share code, notes, and snippets.

@kevsersrca
Last active August 7, 2018 11:10
Show Gist options
  • Save kevsersrca/6eb307bf21f8e5f3d84a58379aae1e98 to your computer and use it in GitHub Desktop.
Save kevsersrca/6eb307bf21f8e5f3d84a58379aae1e98 to your computer and use it in GitHub Desktop.
influxdbtest
//Yeni db oluşturulması
curl -XPOST "http://localhost:8086/query?u=user&p=pass" --data-urlencode "q=CREATE DATABASE monitor"
//insert işlemi
curl -XPOST "http://localhost:8086/write?db=monitor&u=user&p=pass" -d 'network_traffic,host=test,interface=eth1,direction=inbound value=1'
//select işlemi
curl -G "http://localhost:8086/query?pretty=true&u=user&p=pass" --data-urlencode "db=mydb" --d "q=SELECT * FROM network_traffic"
//Script Örneği
counter=1
while [ $counter -le 1000 ]
do
curl -XPOST "http://localhost:8086/write?db=monitor&u=user&p=pass" -d "network_traffic,host=test,interface=eth1,direction=inbound value=$counter"
((counter++))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment