# Parsing Json Logs

**URL:** <https://discuss.elastic.co/t/parsing-json-logs/125837>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 28, 2018, 12:28am UTC](https://discuss.elastic.co/t/parsing-json-logs/125837 "2018-03-28T00:28:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gert\_Humphris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gert_humphris/32/48441_2.png) [@Gert\_Humphris](https://discuss.elastic.co/u/Gert_Humphris)\
**Post date:** [March 28, 2018, 12:28am UTC](https://discuss.elastic.co/t/parsing-json-logs/125837/1 "2018-03-28T00:28:38Z")

</div>

Hi Guys

I'm new to Elastic and have been searching lots to try and find an answer.

I have a multiline JSON that I'm trying to create a single event for.

The Json looks like this:

```
   {
    "SourceInfo": "C:\\Modules\\User\\xTestCompositeModule\\DSCResources\\cTestBaseline\\cTestBaseline.schema.psm1::33::1::File"
    "ModuleName": "PSDesiredStateConfiguration"
    "DurationInSeconds": "0"
    "InstanceName": "TestFolder::[cTestBaseline]Baseline"
    "StartDate": "2018-03-28T10:51:54.4820000+13:00"
    "ResourceName": "File"
    "ModuleVersion": "1.1"
    "RebootRequested": "False"
    "ResourceId": "[File]TestFolder::[cTestBaseline]Baseline"
    "ConfigurationName": "ServerConfigV2"
    "InDesiredState": "True"
}

```

My filebeat config is:

```
filebeat.prospectors:

```

- paths:
  - C:\Log\*.\*  
input\_type: log  
multiline.pattern: '^{'  
multiline.negate: true  
multiline.match: after

processors:

- decode\_json\_fields:  
fields: ['message']  
target: json

output.elasticsearch:  
hosts: ["[http://172.17.16.103:9200](http://172.17.16.103:9200)"]

Only issue I'm getting is that all the fields are contained inside the message field on Elasticsearch.

 ![dscpic](https://us1.discourse-cdn.com/elastic/original/3X/2/2/2219b1d539b00f2b079f4e93b51a70f76bc2e34b.JPG)

thanks in advance for the help.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [March 28, 2018, 6:25am UTC](https://discuss.elastic.co/t/parsing-json-logs/125837/2 "2018-03-28T06:25:10Z")

</div>

The target config should do the job here: [https://www.elastic.co/guide/en/beats/filebeat/current/decode-json-fields.html](https://www.elastic.co/guide/en/beats/filebeat/current/decode-json-fields.html) As you already have this in I'm wondering if perhaps something is off with the indentation of the config. Can you put 3 ticks before and after your config to make sure the formatting appears correctly in the post?

Which version of Filebeat are you using?  
I assume you want all fields to show up under the `json` key.

---

<div class="post-metadata">

**Author:** ![Gert\_Humphris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gert_humphris/32/48441_2.png) [@Gert\_Humphris](https://discuss.elastic.co/u/Gert_Humphris)\
**Post date:** [March 28, 2018, 8:44pm UTC](https://discuss.elastic.co/t/parsing-json-logs/125837/3 "2018-03-28T20:44:17Z")

</div>

Hi Ruflin

thank you for the response. If you say my config looks correct then let me play and make sure my indentation is correct. Then I will post back once I'm done.

---

<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:** [April 25, 2018, 8:44pm UTC](https://discuss.elastic.co/t/parsing-json-logs/125837/4 "2018-04-25T20:44:22Z")

</div>

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