enclose url with params
``` curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" \ --data-urlencode "q=SELECT * FROM cpu WHERE host='server01' AND time < now() - 1d" ``` Running this on ubuntu will get an error: ``` curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" --data-urlencode "q=SELECT mean(load) FROM cpu WHERE region='uswest'" No matches for wildcard “http://localhost:8086/query?pretty=true”. fish: curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" --data-urlencode "q=SELECT mean(load) FROM cpu WHERE region='uswest'" ^ curl: no URL specified! curl: try 'curl --help' or 'curl --manual' for more information ``` for url here is not enclosed with `'`.pull/8795/head
parent
2f4315ccdf
commit
bd61c7ee11
|
@ -46,13 +46,13 @@ curl -XPOST 'http://localhost:8086/write?db=mydb' \
|
|||
|
||||
### Query for the data
|
||||
```JSON
|
||||
curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" \
|
||||
curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" \
|
||||
--data-urlencode "q=SELECT * FROM cpu WHERE host='server01' AND time < now() - 1d"
|
||||
```
|
||||
|
||||
### Analyze the data
|
||||
```JSON
|
||||
curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" \
|
||||
curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" \
|
||||
--data-urlencode "q=SELECT mean(load) FROM cpu WHERE region='uswest'"
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue