Open jpds opened 2 months ago
Looks like this was not intended to support floats: https://github.com/vectordotdev/vrl/blob/4581a47148cef81e9232cb5e72355b5010723371/src/stdlib/from_unix_timestamp.rs#L219-L229
I've worked around this for now by doing:
.tmp_timestamp, err = .ts * 1000
if err != null {
log("Unable to parse ts value: " + err, level: "error")
} else {
.timestamp = from_unix_timestamp!(to_int!(.tmp_timestamp), unit: "milliseconds")
del(.tmp_timestamp)
}
👍 it makes sense to me for from_unixtimestamp
to support floats. The workaround you discovered is what I would have recommended for now.
A note for the community
Use Cases
Caddy logs timestamps as floats:
"ts":1714987958.264331
- however thefrom_unix_timestamp
only takes integers.Attempted Solutions
I've worked around this by calling
to_int!(.ts)
, however it'd be nice to keep the sub-second accuracy for request order sorting.Proposal
No response
References
No response
Version
0.37.1