# Filebeat to Elasticsearch grok example

**URL:** https://discuss.elastic.co/t/filebeat-to-elasticsearch-grok-example/230193
**Category:** Beats
**Tags:** filebeat
**Created:** [April 28, 2020, 2:08pm UTC](https://discuss.elastic.co/t/filebeat-to-elasticsearch-grok-example/230193 "2020-04-28T14:08:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkk/32/67302_2.png) [@rkk](https://discuss.elastic.co/u/rkk)
#### Post date: [April 28, 2020, 2:08pm UTC](https://discuss.elastic.co/t/filebeat-to-elasticsearch-grok-example/230193/1 "2020-04-28T14:08:08Z")

</div>

Hi,

I would like to send log files using filebeat directly to elasticsearch but lines in log file are in custom string format and I would like preprocess those lines using grok or something?

I cannot seem to find any example, how to configure filebeat.yml to use regex, grok to send log files directly to elasticsearch; is out there any example?

My log file lines look like:

`[28-Apr-2020 14:01:58 +0000]: <nht5271m> Successful login for username1 (ID: 1) from 111.222.333.444 in session nht5271mokfeqd1i`

Kind regards,

Rok

---

<div class="post-metadata">

### Author: ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)
#### Post date: [April 28, 2020, 3:35pm UTC](https://discuss.elastic.co/t/filebeat-to-elasticsearch-grok-example/230193/2 "2020-04-28T15:35:28Z")

</div>

Have you tried the Elasticsearch module of Filebeat? [https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-elasticsearch.html](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-elasticsearch.html)

Alternatively, you could use the dissect processor to parse the event: [https://www.elastic.co/guide/en/beats/filebeat/current/dissect.html](https://www.elastic.co/guide/en/beats/filebeat/current/dissect.html)

---

<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: [May 26, 2020, 3:35pm UTC](https://discuss.elastic.co/t/filebeat-to-elasticsearch-grok-example/230193/3 "2020-05-26T15:35:29Z")

</div>

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