# Insterting data through a txt file

**URL:** <https://community.influxdata.com/t/insterting-data-through-a-txt-file/13692>\
**Category:** Store\
**Tags:** time\
**Created:** [March 31, 2020, 5:43pm UTC](https://community.influxdata.com/t/insterting-data-through-a-txt-file/13692 "2020-03-31T17:43:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roekens](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/roekens/32/4681_2.png) [@Roekens](https://community.influxdata.com/u/Roekens)\
**Post date:** [March 31, 2020, 5:43pm UTC](https://community.influxdata.com/t/insterting-data-through-a-txt-file/13692/1 "2020-03-31T17:43:28Z")

</div>

Hi,

I want to insert data in influxdb through a txt file. But i want to send the time as well but as the precision rfc3339 format.

So i thought that this was the solution:  
Txt file: cpu,host=server02 value=0.67 2020-03-31T15:00:00Z  
Terminal: curl -i -XPOST ‘[http://localhost:8086/write?db=test&precision=RFC3339](http://localhost:8086/write?db=test&precision=RFC3339)’ --data-binary @InfluxData.txt

But if i do that i got the following error

 ![error.](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/e/e3b9b792f419b2f939577af69b59dd3e0a3ecb2c.png)

Btw: if i don’t give a timestamp in the textfile it does log the data at the servertime so the link to the txt file is no problem.

Do anybody know if it is possible in the first place?

Thanks at advance!  
Kind regards,  
Ward

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [April 1, 2020, 3:39pm UTC](https://community.influxdata.com/t/insterting-data-through-a-txt-file/13692/2 "2020-04-01T15:39:56Z")

</div>

Hello @Roekens,  
Welcome!  
Time must be in [unix timestamp](https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/#timestamp) for line protocol. Otherwise if you want to keep the data in rfc3339 you could use the [file](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/file) or [tail plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/tail).  
You can also write a txt with `influx -import -path=yourfilepath -precision=ns`  
then before you query you can use ```precision rfc3339```` to convert the unix timstamp to rfc3339.  
I recommend taking a look at [this documentation](https://docs.influxdata.com/influxdb/v1.7/guides/writing_data/) and this [blog on how to write data to Influxdb](https://www.influxdata.com/blog/getting-started-writing-data-to-influxdb/) using the import command and some telegraf plugins.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/3X/2/f/2feb065bdfd5e4b7728243aa3b9192ad3e8447c1.png) [@system](https://community.influxdata.com/u/system)\
**Post date:** [April 3, 2020, 3:15pm UTC](https://community.influxdata.com/t/insterting-data-through-a-txt-file/13692/3 "2020-04-03T15:15:49Z")

</div>

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.
