# Apache/nginx logs wrapped in syslog format

**URL:** <https://discuss.elastic.co/t/apache-nginx-logs-wrapped-in-syslog-format/207211>\
**Category:** Logs\
**Created:** [November 9, 2019, 12:04pm UTC](https://discuss.elastic.co/t/apache-nginx-logs-wrapped-in-syslog-format/207211 "2019-11-09T12:04:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![w\_o\_j\_t\_e\_k](https://avatars.discourse-cdn.com/v4/letter/w/a4c791/32.png) [@w\_o\_j\_t\_e\_k](https://discuss.elastic.co/u/w_o_j_t_e_k)\
**Post date:** [November 9, 2019, 12:04pm UTC](https://discuss.elastic.co/t/apache-nginx-logs-wrapped-in-syslog-format/207211/1 "2019-11-09T12:04:31Z")

</div>

Hi,

I've got a centralized log server that receives apache + nginx logs. I would like to use filebeat on this box to forward these logs into elastic.

The logs are wrapped in the syslog format, e.q:  
2019-11-09T11:50:56+00:00 foobar nginx\_access: 202.18.3.162 - - [09/Nov/2019:11:50:56 +0000] "GET / HTTP/1.1" 301 178 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"

so first columns are added by rsyslog therefore i can't use apache/nginx filebeat module

Obviously I could change rsyslog format to exclude these 3 columns (ts, host, tag) but wondering if it's possible to pre-process on the filebeat level so I can use filebeat modules rather than writting my post processors

Regards

---

<div class="post-metadata">

**Author:** ![Ivan.fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivan.fernandez/32/84457_2.png) [@Ivan.fernandez](https://discuss.elastic.co/u/Ivan.fernandez)\
**Post date:** [November 11, 2019, 8:57am UTC](https://discuss.elastic.co/t/apache-nginx-logs-wrapped-in-syslog-format/207211/2 "2019-11-11T08:57:45Z")

</div>

You can use a processor to split your log into fields before to put it in the Filebeat index, the grok processor fits to what you want to make  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)  
there are also more processors that you can check if you think that grok is not the one you need [https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-processors.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-processors.html)

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [November 11, 2019, 10:40am UTC](https://discuss.elastic.co/t/apache-nginx-logs-wrapped-in-syslog-format/207211/3 "2019-11-11T10:40:33Z")

</div>

Hi @w_o_j_t_e_k,

it should be possible to [override the module's input settings](https://www.elastic.co/guide/en/beats/filebeat/current/advanced-settings.html#advanced-settings) and add a `dissect` or `script` processor in front that discards the prefix. The [original configuration applied by the nginx access log module](https://github.com/elastic/beats/blob/6a034782a2aa363c539000e3b307b00178d29080/filebeat/module/nginx/access/config/nginx-access.yml) seems to apply the `add_locale` processor.

Let us know if that works for you.

---

<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:** [December 9, 2019, 10:40am UTC](https://discuss.elastic.co/t/apache-nginx-logs-wrapped-in-syslog-format/207211/4 "2019-12-09T10:40:38Z")

</div>

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