# How to Generate logs in json format using .yml file

**URL:** https://discuss.elastic.co/t/how-to-generate-logs-in-json-format-using-yml-file/124575
**Category:** Logstash
**Created:** [March 19, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-to-generate-logs-in-json-format-using-yml-file/124575 "2018-03-19T14:30:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [March 19, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-to-generate-logs-in-json-format-using-yml-file/124575/1 "2018-03-19T14:30:52Z")

</div>

Hi

I am uisng LS 5.2.2 version, i am able to generate logs in json format using command line like this

```
/bin> logstash.bat --debug -f xyz.conf --log.format json

```

i want to generate the json logs through control of logstash.yml file, i have added below line in the yml file, but it does not work

> `log.format : json`

and i use this below while running pipeline

> /bin\> logstash.bat --debug -f xyz.conf

Please let me know the right entry in .yml file, as i have followed the documentation.

I have followed the documentation of LS 5.2.2,not sure if this a bug

---

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [March 31, 2018, 3:56am UTC](https://discuss.elastic.co/t/how-to-generate-logs-in-json-format-using-yml-file/124575/2 "2018-03-31T03:56:45Z")

</div>

Hi

Did,anyone has experienced this?  
Can we do this via yml file?

---

<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 28, 2018, 3:56am UTC](https://discuss.elastic.co/t/how-to-generate-logs-in-json-format-using-yml-file/124575/3 "2018-04-28T03:56:46Z")

</div>

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