# Filebeat with MSSQL and utf-16le

**URL:** https://discuss.elastic.co/t/filebeat-with-mssql-and-utf-16le/210944
**Category:** Beats
**Tags:** filebeat
**Created:** [December 6, 2019, 10:00pm UTC](https://discuss.elastic.co/t/filebeat-with-mssql-and-utf-16le/210944 "2019-12-06T22:00:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Christian\_SANCHEZ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_sanchez/32/43557_2.png) [@Christian\_SANCHEZ](https://discuss.elastic.co/u/Christian_SANCHEZ)
#### Post date: [December 6, 2019, 10:00pm UTC](https://discuss.elastic.co/t/filebeat-with-mssql-and-utf-16le/210944/1 "2019-12-06T22:00:44Z")

</div>

Hello  
I am using Stack 7.4.0 on Windows 10 trying to parse my MSSQL logs.  
When using the filebeat.input as below it works file. Lines are correctly decoded  
and multiline is correctly handled.

```
filebeat.inputs:
- type: log
  encoding: utf-16le
  enabled: true
  paths: 
    - C:/PathOfMSSQL/MSSQLLOG/ERRORLOG*
  exclude_files: [".gz$"]
  multiline.pattern: '^\d\d'
  multiline.negate: true
  multiline.match: after  

```

But when i declare to use the mssql module, encoding is not taken in account and the whole file is considered as the message.  
Here is the sample of the mssql module

```
filebeat.modules:
- module: mssql
  enabled: true
  log:
    encoding: utf-16le
    enabled: true
    var.paths: ["C:/PathOfMSSQL/MSSQLLOG/ERRORLOG*"]
    exclude_files: [".gz$"]
    multiline.pattern: '^\d\d'
    multiline.negate: true
    multiline.match: after 

```

Any Guess ?

---

<div class="post-metadata">

### Author: ![MarianaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marianad/32/42687_2.png) [@MarianaD](https://discuss.elastic.co/u/MarianaD)
#### Post date: [December 9, 2019, 9:33am UTC](https://discuss.elastic.co/t/filebeat-with-mssql-and-utf-16le/210944/2 "2019-12-09T09:33:43Z")

</div>

hi @Christian_SANCHEZ, can you try:

```auto
 module: mssql
  log:
     enabled: true
     var.paths: ["C:/PathOfMSSQL/MSSQLLOG/ERRORLOG*"]

    input:
        encoding: utf-16le
        exclude_files: [".gz$"]
        multiline.pattern: '^\d\d'
        multiline.negate: true
        multiline.match: after

```

let us know if this worked in your case.

---

<div class="post-metadata">

### Author: ![Christian\_SANCHEZ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_sanchez/32/43557_2.png) [@Christian\_SANCHEZ](https://discuss.elastic.co/u/Christian_SANCHEZ)
#### Post date: [December 9, 2019, 1:50pm UTC](https://discuss.elastic.co/t/filebeat-with-mssql-and-utf-16le/210944/3 "2019-12-09T13:50:23Z")

</div>

Hello  
IT WORKS  
Thank you very much  
😃

---

<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: [January 6, 2020, 1:50pm UTC](https://discuss.elastic.co/t/filebeat-with-mssql-and-utf-16le/210944/4 "2020-01-06T13:50:23Z")

</div>

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