Query to obtain periodical raw data

Hey all!

I’m working on a system and it’s necessary for me to extract raw data from the last two weeks, every 24 hours.

I have tried automating this by creating a bash script that sends a curl to the api, it looks like this:

curl -v --request POST   http://localhost:8086/api/v2/query?orgID=(OrgID)     
--header 'Authorization: Token (mytoken)'   --header 'Accept: application/csv'   --header 'Content-type: application/vnd.flux'   --data 'from(bucket:"bucket-name") 
        |> range(start: -14d) 
        |> filter(fn: (r) => r._measurement == "measurement") 
        |> aggregateWindow(every: 1h, fn: mean)' > /home/user/influxCSV.txt 

the bash script is executed automatically every 24 hours with a service and a timer that keeps track of it.

However as you may have noticed, in my query we have the part "|> aggregateWindow(every: 1h, fn: mean)’ " which would imply that the data is not raw, but rather uses the mean function.

If i remove the aggregate window line, the query doesn’t return anything.

how could i get the absolute raw input from influx?

Hello @testiacco,
That is strange. You should be able to query without using the aggregateWindow() function.
That doesn’t make any sense. Are you not getting any errors?
You could try adding a |>yield(name:"foo") but that honestly shouldn’t make a difference. How many points are you querying of raw data?