# What would be the easiest way to hook into filebeat?

**URL:** <https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 7, 2017, 4:15am UTC](https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834 "2017-01-07T04:15:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![blacktop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blacktop/32/14155_2.png) [@blacktop](https://discuss.elastic.co/u/blacktop)\
**Post date:** [January 7, 2017, 4:15am UTC](https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834/1 "2017-01-07T04:15:31Z")

</div>

I would like to hook into Filebeat once it has a handle on a new file. I think what I need is to create my own `reader` that is `tsv.go` (tab separated value) and implement the Reader interface?

The reason I want to do this is that the log files I am parsing have a header that can change a lot and explains how to parse the file field name/types etc.

From what I can see in the code that would allow me to define what the `Next()` method would output for `message`

Does that sound right or am I completely lost?

Thanks.

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [January 7, 2017, 6:14am UTC](https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834/2 "2017-01-07T06:14:23Z")

</div>

Why not try the CSV filter, it deals with headers in files, just specify an alternate delimiter  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html)

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [January 10, 2017, 8:55am UTC](https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834/3 "2017-01-10T08:55:41Z")

</div>

Can you share an example of such a file? If it is a new file type, I would opt for a new prospector type (`input_type`). This makes things a little bit more complex. To get started and play around with it, adding a reader is definitively a good idea 😉

---

<div class="post-metadata">

**Author:** ![blacktop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blacktop/32/14155_2.png) [@blacktop](https://discuss.elastic.co/u/blacktop)\
**Post date:** [January 15, 2017, 8:11pm UTC](https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834/4 "2017-01-15T20:11:39Z")

</div>

Do you think the new go1.8 plugin system will allow for hookin into filebeat? Or have you considered abstracting the log file read/parse/registry (state tracking) back into libbeat?

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [January 17, 2017, 9:05am UTC](https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834/5 "2017-01-17T09:05:59Z")

</div>

There is currently no plugin architecture yet in filebeat. But it is planned to push the abstraction forward in filebeat to have prospectors plugin like.

---

<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:** [February 14, 2017, 9:06am UTC](https://discuss.elastic.co/t/what-would-be-the-easiest-way-to-hook-into-filebeat/70834/6 "2017-02-14T09:06:00Z")

</div>

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