# File-input , how to add file offset as a new field

**URL:** https://discuss.elastic.co/t/file-input-how-to-add-file-offset-as-a-new-field/93323
**Category:** Logstash
**Created:** [July 17, 2017, 1:48am UTC](https://discuss.elastic.co/t/file-input-how-to-add-file-offset-as-a-new-field/93323 "2017-07-17T01:48:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ryan\_Qian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_qian/32/2148_2.png) [@Ryan\_Qian](https://discuss.elastic.co/u/Ryan_Qian)
#### Post date: [July 17, 2017, 1:48am UTC](https://discuss.elastic.co/t/file-input-how-to-add-file-offset-as-a-new-field/93323/1 "2017-07-17T01:48:51Z")

</div>

I have smillar question as this one, need the offset to maintain the log order (which logs happen at same timestamp)

> [@How to maintain the order of logs](https://discuss.elastic.co/t/how-to-maintain-the-order-of-logs/53397/4):
>
> Thanks Christian. It works

Thanks

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 17, 2017, 5:26am UTC](https://discuss.elastic.co/t/file-input-how-to-add-file-offset-as-a-new-field/93323/2 "2017-07-17T05:26:17Z")

</div>

There is an [open issue](https://github.com/logstash-plugins/logstash-input-file/issues/7) in the file input plugin repository around this, so it is currently not possible. Filebeat can however already provide this, so you may want to consider using it as a collector.

---

<div class="post-metadata">

### Author: ![Ryan\_Qian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_qian/32/2148_2.png) [@Ryan\_Qian](https://discuss.elastic.co/u/Ryan_Qian)
#### Post date: [July 17, 2017, 5:41am UTC](https://discuss.elastic.co/t/file-input-how-to-add-file-offset-as-a-new-field/93323/3 "2017-07-17T05:41:22Z")

</div>

Thanks, I notice that issue. I will try patch way for workaround - don't want to involve another components into system, as a logs shipment way, rsyslog is really good enough.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 14, 2017, 5:41am UTC](https://discuss.elastic.co/t/file-input-how-to-add-file-offset-as-a-new-field/93323/4 "2017-08-14T05:41:51Z")

</div>

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