While persisting data in influx-db, there is a column name Time which is managed by influx itself. By default the format in which time stored is 2023-08-29T07:43:46.872Z
I am trying to store the timestamp in Unix format, which is not happening.
I am using following module
https://github.com/InfluxCommunity/influxdb3-go
And below is my implementation in goLang to persist data in influx-db.
eventTime := time.Now().UnixNano()
timeSt := time.Now().UnixNano()
line := fmt.Sprintf("stat,avg=%f,max=%f eventTime=%d %d", 22.3, 40.3, eventTime, timeSt)
err = client.Write(context.Background(), []byte(line))
if err != nil {
panic(err)
}
Here as the line protocol suggests having
measurement, tagSet=value fieldSet=value timestamp
here the timestamp is getting ignored. And following is stored in my influx-db
Expectation is to have the Epoch in Time column.
Also a followup question - can we update the name of column Time?