Reinsert a csv dump using telegraf input.file : how restore original time stamp?

I have a set of data dumped from influxDB in a CSV file.

I want to import the data back in to InfluxDB (after some modificaton to fields/tags) but would like to restore the original timestamp which is included in the CSV file.

I tried:

  csv_timestamp_column = "time"
  csv_timestamp_format = "unix_ns"

but the timestamp for new entry in the database does not match the timestamp in the CSV file.

Here is the row from the dump (with columns truncated for clarity):
yourdata,1663530473368058074,...,2022-09-19T01:17:53,Grafana

2022-10-02T15:47:05Z D! [agent] Starting service inputs
> mydata,host=Grafana, ....  ,Time="2022-09-19T01:17:53" 1663530473000000000
2022-10-02T15:47:10Z D! [agent] Stopping service inputs

Original Timestamp is 1663530473368058074 but telegraf output is 1663530473000000000

Can somebody explain to me why this could be happening please?

For my current application this lost of precision is acceptable since I get to see the original time stamp to hh:mm:ss precision getting restored.

The default precision in telegraf is in seconds. You need to set the precision parameter in the agent config to 1ns as well if you want nanosecond precision on your metrics. See the config docs for more.