# Filebeat encodes harvested content before shipping

**URL:** <https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 25, 2018, 10:53am UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976 "2018-10-25T10:53:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![CyberSeppi](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CyberSeppi](https://discuss.elastic.co/u/CyberSeppi)\
**Post date:** [October 25, 2018, 10:53am UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/1 "2018-10-25T10:53:53Z")

</div>

Hi guys,

first the problem  
I´m running filebeat on an apache webserver and want to ship the access logs to logstash.  
I ran into problems with the content of shipment and already narrowed it down to filebeat:  
The output is file atm and I sometimes see those lines in file:

> {"@timestamp":"2018-10-25T10:30:25.943Z","@metadata":{"beat":"filebeat","type":"doc","version":"6.4.2"},"prospector":{"type":"log"},"input":{"type":"log"},"beat":{"name":"liintra311","hostname":"liintra311","version":"6.4.2"},"host":{"name":"liintra311"},"source":"/www/vofapl-int-401-ui/logs/apache/liintra312.access\_log","offset":4832199,"message":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000141.77.10.108 [vofapl-int-401.bmwgroup.net](http://vofapl-int-401.bmwgroup.net) qxv1658 [25/Oct/2018:12:30:21 +0200] "GET /vofapl\_bc/api/v1/program\_scenario/22695/product\_type/1/placement/scenariostate HTTP/1.1" 200 80 "[https://vofapl-int-401.bmwgroup.net/vofapl\_ui/?conversationid=S3gGR7VQosPrBtebKHdl\u0026env=workplace\u0026lang=de\u0026mwpOrigin=https%3A%2F%2Fworkplace-int2.bmwgroup.net\u0026strongAuth=1\](https://vofapl-int-401.bmwgroup.net/vofapl_ui/?conversationid=S3gGR7VQosPrBtebKHdl%5Cu0026env=workplace%5Cu0026lang=de%5Cu0026mwpOrigin=https%3A%2F%2Fworkplace-int2.bmwgroup.net%5Cu0026strongAuth=1%5C)" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36"","type":"apache-access-logs"}

As I said this already happens on filebeat side, so I won´t post logstash or other config here.  
This is my filebeat config

./filebeat.yml

> filebeat.config.modules:  
> enabled: true  
> path: ${path.config}/modules.d/\*.yml
> 
> filebeat.prospectors:
> 
> filebeat.config.inputs:  
> enabled: true  
> path: conf.d/\*.yml  
> reload.enabled: true  
> reload.period: 10s
> 
> #output.logstash:
> 
> # hosts: ["10.248.114.155:5044"]
> 
> # bulk\_max\_size: 5120
> 
> output.file:  
> path: "/lfs/elastic/filebeat-6.4.2-linux-x86\_64"  
> filename: filebeat-output  
> rotate\_every\_kb: 10000  
> number\_of\_files: 7  
> permissions: 0600  
> bulk\_max\_size: 0

and this is the prospector config (./conf.d/apache-access-logs.yml

> - type: log  
> paths:

I have no clue whats going on and hope somebody can help me here ☹  
Found some topics about similar problems, but they gave my finally no helpful hints about that ☹

Thanks guys!

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [October 25, 2018, 1:14pm UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/2 "2018-10-25T13:14:25Z")

</div>

> [@CyberSeppi](#):
>
> \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000141.77.10.108 [vofapl-int-401.bmwgroup.net](http://vofapl-int-401.bmwgroup.net) qxv1658 [25/Oct/2018:12:30:21 +0200] "GET /vofapl\_bc/api/v1/program\_scenario/22695/product\_type/1/placement/scenariostate HTTP/1.1" 200 80 "[https://vofapl-int-401.bmwgroup.net/vofapl\_ui](https://vofapl-int-401.bmwgroup.net/vofapl_ui/?conversationid=S3gGR7VQosPrBtebKHdl%5Cu0026env=workplace%5Cu0026lang=de%5Cu0026mwpOrigin=https%3A%2F%2Fworkplace-int2.bmwgroup.net%5Cu0026strongAuth=1)

This look weird at first, but I think your multiline pattern might be wrong,

The following look like the end of a message:

```auto
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000

```

And this look like the beginning:

```auto
[25/Oct/2018:12:30:21 +0200] "GET /vofapl_bc/api/v1/program_scenario/22695/product_type/1/placement/scenariostate HTTP/1.1" 200 80 

```

---

<div class="post-metadata">

**Author:** ![CyberSeppi](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CyberSeppi](https://discuss.elastic.co/u/CyberSeppi)\
**Post date:** [October 25, 2018, 1:46pm UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/3 "2018-10-25T13:46:53Z")

</div>

You´re right, that are 2 different logs, but the strange thing is, where theses /u0000 chars are coming from anyway ....

---

<div class="post-metadata">

**Author:** ![CyberSeppi](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CyberSeppi](https://discuss.elastic.co/u/CyberSeppi)\
**Post date:** [October 25, 2018, 4:13pm UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/4 "2018-10-25T16:13:05Z")

</div>

tracked one happening exactly and this seems to narrow down things immensely, but I don´t know the solution

This is the filebeat output (snippet)

> /?conversationid=yorat4kDWJnec6hw8vXf\u0026env=w

This is where it comes from (source)

> /?conversationid=yorat4kDWJnec6hw8vXf&env=w

Filebeat seems to encode the input, but i don´t know why ?

the logfile has these details

> file -bi /www/vofapl-int-401-ui/logs/apache/liintra312.access\_log
> 
> text/plain charset=us-ascii

---

<div class="post-metadata">

**Author:** ![CyberSeppi](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CyberSeppi](https://discuss.elastic.co/u/CyberSeppi)\
**Post date:** [October 26, 2018, 11:03am UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/5 "2018-10-26T11:03:19Z")

</div>

Nobody .... ? to me it seems to be a configuration issue, but I wasn´t able to effect any change with configuration changes.....  
Sure, I can control how the harvesters work in respect of opening and closing files, I can also change the encoding generally, but nothing changed that behaviour which I mentioned so far ☹  
It´s pretty frustrating ☹

---

<div class="post-metadata">

**Author:** ![CyberSeppi](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CyberSeppi](https://discuss.elastic.co/u/CyberSeppi)\
**Post date:** [October 26, 2018, 12:10pm UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/6 "2018-10-26T12:10:15Z")

</div>

OMG, interesting stuff....  
I configured the codec for my fileoutput like that now

> output.file:  
> .....  
> codec.format:  
> string: '%{[@timestamp]} %{[message]}'

And I don´t see any of these "\uxxx" encodings anymore ....  
Means it happens during json transformation ?

---

<div class="post-metadata">

**Author:** ![CyberSeppi](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CyberSeppi](https://discuss.elastic.co/u/CyberSeppi)\
**Post date:** [October 27, 2018, 8:06pm UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/7 "2018-10-27T20:06:31Z")

</div>

Really nobody ... ? Somebody knows at least how I could dive deeper into this ?

---

<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:** [November 24, 2018, 8:09pm UTC](https://discuss.elastic.co/t/filebeat-encodes-harvested-content-before-shipping/153976/8 "2018-11-24T20:09:33Z")

</div>

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