# Json format file not parsing

**URL:** https://discuss.elastic.co/t/json-format-file-not-parsing/210318
**Category:** Beats
**Tags:** filebeat
**Created:** [December 3, 2019, 9:39am UTC](https://discuss.elastic.co/t/json-format-file-not-parsing/210318 "2019-12-03T09:39:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![atahanceylan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atahanceylan/32/58691_2.png) [@atahanceylan](https://discuss.elastic.co/u/atahanceylan)
#### Post date: [December 3, 2019, 9:39am UTC](https://discuss.elastic.co/t/json-format-file-not-parsing/210318/1 "2019-12-03T09:39:52Z")

</div>

Even if my JSON file is valid it is not parsed into fields. Whole json object is placed in message. My ELK stack is running on docker.

My filebeat yml is like this:

filebeat.inputs:

- type: log  
enabled: true  
paths:
  - /logs/_/_.json
  - /logs/\*.json

- type: container  
enabled: true  
paths:
  - /var/lib/docker/containers/_/_.log

processors:

- add\_docker\_metadata:  
host: "unix:///var/run/docker.sock"

- decode\_json\_fields:  
fields: ["message"]  
target: "json"  
overwrite\_keys: true  
output.logstash:  
enabled: true  
hosts: ["logstash:5044"]

logging.json: true  
logging.metrics.enabled: false  
logging.level: warning

Example log:

After each Json object there is (CRLF) carriage return linefeed

{"RequestUri":"/a/b/c/AdvancedList.aspx","Url":"/a/b/c/d/e/AdvancedList.aspx","UserAgent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36","UrlReferrer":null,"Message":"Error occurred during search on AdvancedList\r\n Object reference not set to an instance of an object.\r\n","ExceptionType":"","Callstack":" at Publisher.UI.Web.Pages.AdvancedList.ShowArticleBasedContentTypes(SearchArgs search, IDictionary`2 autoSavedArticleId) in D:\\git\\b\\c\\d\\e\\AdvancedList.aspx.cs:line 550","AdditionalExceptionData":"","Level":null,"UserId":"3276","ItemType":null,"ItemIdentifier":null,"StatusNote":null,"HttpMethod":null,"ContextEntity":"MXY","ContextCulture":"en-US-TEST","ContextTool":"ee","ContextUser":"fff","Context":null,"CallerVersion":"7.36.0.0","LoggedBy":"XXX.Publisher.UI.Web.Pages.AdvancedList.ShowArticleBasedContentTypes at offset 3911 in file:line:column D:\\git\\b\\c\\cd\\d\\AdvancedList.aspx.cs:550:17","CurrentCulture":"en-US","CurrentUICulture":"en-US","ProcessID":"001888","ThreadName":"https://abc/AdvancedList.aspx","MachineName":"sadsdasad","UserName":"WS_appPool","AppDomainName":"/LM/W3SVC/144/ROOT/publisher-6-132188908047459293","ThreadIdentity":"eee","WindowsIdentity":"ONLINE\\WS_appPool","UserIPAddress":"127.0.0.1","ProcessName":"w3wp","CommandLine":"c:\\windows\\system32\\inetsrv\\w3wp.exe -ap \"eee\" -v \"v4.0\" -l \"webengine4.dll\" -a \\\\.\\pipe\\iisipm7da4c902-3a2b-473a-96ba-411b5271be7a -h \"C:\\inetpub\\temp\\apppools\\eee\\eee.config\" -w \"\" -m 0 -t 20 -ta 0","LogVersion":"17.32.0.0"} {"RequestUri":"/a/b/c/AdvancedList.aspx","Url":"/a/b/c/d/e/AdvancedList.aspx","UserAgent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36","UrlReferrer":null,"Message":"Error occurred during search on AdvancedList\r\n Object reference not set to an instance of an object.\r\n","ExceptionType":"","Callstack":" at Publisher.UI.Web.Pages.AdvancedList.ShowArticleBasedContentTypes(SearchArgs search, IDictionary`2 autoSavedArticleId) in D:\git\b\c\d\e\AdvancedList.aspx.cs:line 550","AdditionalExceptionData":"","Level":null,"UserId":"3276","ItemType":null,"ItemIdentifier":null,"StatusNote":null,"HttpMethod":null,"ContextEntity":"MXY","ContextCulture":"en-US-TEST","ContextTool":"ee","ContextUser":"fff","Context":null,"CallerVersion":"7.36.0.0","LoggedBy":"XXX.Publisher.UI.Web.Pages.AdvancedList.ShowArticleBasedContentTypes at offset 3911 in file:line:column D:\git\b\c\cd\d\AdvancedList.aspx.cs:550:17","CurrentCulture":"en-US","CurrentUICulture":"en-US","ProcessID":"001888","ThreadName":"[https://abc/AdvancedList.aspx","MachineName":"sadsdasad","UserName":"WS\_appPool","AppDomainName":"/LM/W3SVC/144/ROOT/publisher-6-132188908047459293","ThreadIdentity":"eee","WindowsIdentity":"ONLINE\WS\_appPool","UserIPAddress":"127.0.0.1","ProcessName":"w3wp","CommandLine":"c:\windows\system32\inetsrv\w3wp.exe](https://abc/AdvancedList.aspx%22,%22MachineName%22:%22sadsdasad%22,%22UserName%22:%22WS_appPool%22,%22AppDomainName%22:%22/LM/W3SVC/144/ROOT/publisher-6-132188908047459293%22,%22ThreadIdentity%22:%22eee%22,%22WindowsIdentity%22:%22ONLINE%5CWS_appPool%22,%22UserIPAddress%22:%22127.0.0.1%22,%22ProcessName%22:%22w3wp%22,%22CommandLine%22:%22c:%5Cwindows%5Csystem32%5Cinetsrv%5Cw3wp.exe) -ap "eee" -v "v4.0" -l "webengine4.dll" -a \\.\pipe\iisipm7da4c902-3a2b-473a-96ba-411b5271be7a -h "C:\inetpub\temp\apppools\eee\eee.config" -w "" -m 0 -t 20 -ta 0","LogVersion":"17.32.0.0"}

---

<div class="post-metadata">

### Author: ![mathur7vidit](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mathur7vidit](https://discuss.elastic.co/u/mathur7vidit)
#### Post date: [December 3, 2019, 10:35am UTC](https://discuss.elastic.co/t/json-format-file-not-parsing/210318/2 "2019-12-03T10:35:48Z")

</div>

use this

filebeat.prospectors:

- paths:
  - your path.  
input\_type: log  
**json.keys\_under\_root: true**  
**json.add\_error\_key: true**

---

<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 1, 2020, 3:02pm UTC](https://discuss.elastic.co/t/json-format-file-not-parsing/210318/4 "2020-01-01T15:02:26Z")

</div>

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