aserkin
September 5, 2019, 9:52am
1
Just a newbie question. Cant understand what’s wrong with the code:
timeRange=-24h
apnDlStats =
from(bucket: "stat/autogen")
|> range(start: timeRange)
|> filter(fn: (r) =>
r._measurement == "apnSch1" and
r._field == "dnlnk-bytes" and
r.node == "host1"
)
|> group(columns: ["apn"])
|> aggregateWindow(every: 5m, fn: sum)
|> derivative(unit:5m,nonNegative:true)
|> map(fn: (r) => ({
r._value: r._value * 8 / 300
}))
apnDlStats
getting error:
Error: type error 0:0-0:0: invalid record access "_value": int!=float
in common i’m trying to make a flux analog of influx query like this:
SELECT non_negative_derivative(sum(“dnlnk-bytes”), 5m) *8/300 AS “bps”
pwnell
September 5, 2019, 8:16pm
2
Try
r._value: r._value * 8.0 / 300.0
aserkin
September 6, 2019, 8:37am
3
timeRange=-24h
apnDlStats =
from(bucket: "stat/autogen")
|> range(start: timeRange)
|> filter(fn: (r) =>
r._measurement == "apnSch1" and
r._field == "dnlnk-bytes" and
r.node == "nn-sae-1-1"
)
|> group(columns: ["apn"])
|> aggregateWindow(every: 5m, fn: sum)
|> derivative(unit:5m,nonNegative:true)
apnDlStats
|> map(fn: (r) => ({
r._value: r._value * 8.0 / 300.0
}))
This does not work either. Now:
“Error: failed to evaluate map function: null reference used in row function: skipping evaluation until null support is provided”
pwnell
September 6, 2019, 5:22pm
4
I am out of my depth here but read:
I just updated my Influxdb to the latest 1.7.6 version (flux v0.24) and wonderd that the fill() function is not showing up in the FLUX FUNCTIONS dropdown. The does not throw any Error, it just simply does not do anything.
from(bucket: "Export/autogen")
|> range(start: 2019-00-00T00:00:00Z)
|> filter(fn: (r) =>
r._measurement == "Data" and
r._field == "Value" and
r.TagId == "23846"
)
|> fill(column: "_value", usePrevious: true)
|> yield()
It also does nothing when t…
scott
September 9, 2019, 8:31pm
5
What version of InfluxDB are you running? I’d suggest updating to 1.7.8 if you can. Null support is greatly improved in the version packaged with InfluxDB 1.7.8.
aserkin
September 10, 2019, 6:39am
6
Exactly. Upgraded 1.7.7>1.7.8 yesterday and map started working.
Thank you)