Sample Header Ad - 728x90

InfluxQL query returns a "partial" answer over http. Can I curl the whole thing?

0 votes
1 answer
15 views
What’s the right way to pull a _complete_ answer to an InfluxQL query over http? I’m using the [acct_gather plugin](https://slurm.schedmd.com/acct_gather.conf.html) for a slurm cluster. It sends resource usage data to an [influxdb v1](https://docs.influxdata.com/influxdb/v1/) database. So if I write
#SBATCH --profile=Task
in an sbatch file, it records things like memory, I/O, and CPU usage to the database. But if I try to ask for that data as a json file, e.g.,...
jobid=12345
curl -G 'http://:/query ?' \
  --data-urlencode "db=myslurmdatabase" \
  --data-urlencode 'q=select "value" from /./ where "job"='"'$jobid'"
...then I get a **partial** response with only one type of measurement ("CPUFrequency"):
{
  "results": [
    {
      "statement_id": 0,
      "series": [
        {
          "name": "CPUFrequency",
          "columns": [
            "time",
            "value"
          ],
          "values": [

...

          ],
          "partial": true
        }
      ]
    }
  ]
}
I think this happens for jobs that have run past a certain number of data points. ## What I've found - In [this thread on github](https://github.com/grafana/grafana/issues/7380) somebody asked: > So how does it work? Do you get a url with the second chunk or does the http response contain multiple json bodies? Is this compatible with the json decoders in browser? People replied to the effect that modern browsers can handle it, but I don’t think they answered the question directly. - [There’s a “chunked” parameter](https://docs.influxdata.com/influxdb/v1/tools/api/#query-http-endpoint) for the /query endpoint. The options are either true (in which case it chunks based on series or 10,000 data points), or a specific number of points (in which case it chunks based on that number). Chunking happens either way. But it’s not clear to me how to get the _next_ chunk. - It looks like somebody has written [a third-party program](https://github.com/matthewdowney/influxdb-stream) that can stream the chunked results from a query. But is it possible with curl, or would I have to use something like this?
Asked by wobtax (1125 rep)
Aug 5, 2025, 08:39 PM
Last activity: Aug 6, 2025, 03:59 PM