Skip to Content
Industrial Internet Application Development
book

Industrial Internet Application Development

by Alena Traukina, Jayant Thomas, Prashant Tyagi, Veera Kishore Reddipalli
September 2018
Intermediate to advanced
412 pages
11h 12m
English
Packt Publishing
Content preview from Industrial Internet Application Development

Running a query

To run a query, you need to send a GET request to a query endpoint. To do this, in the following code, you should specify the target database (mydb) as the value for the db URL parameter and add the query you want to run as the q URL parameter:

curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SELECT \"value\" FROM \"cpu_load_short\" WHERE \"region\"='us-west'"

InfluxDB will return a response in the JSON format, with the results displayed in the results array. In the case of an error, the database will generate an error key, explaining the cause of the error:

{   "results": [       {           "statement_id": 0,           "series": [               {                   "name": "cpu_load_short",                   "columns": [                       "time",                       "value"                   ], "values": [ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Industrial Internet of Things

Hands-On Industrial Internet of Things

Giacomo Veneri, Antonio Capasso
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 9781788298599Supplemental Content