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?