# How json event is consider while logstash processing

**URL:** <https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151>\
**Category:** Logstash\
**Created:** [September 11, 2018, 1:54pm UTC](https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151 "2018-09-11T13:54:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [September 11, 2018, 1:54pm UTC](https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151/1 "2018-09-11T13:54:42Z")

</div>

HI All,  
I want to process some json file and i'm sending event to logstash using kafka. My json file contains information like this when i process the file how the logstash will consider the event like it will consider as whole message as single event or else it will consider each line as single single event.  
{  
"glossary": {  
"title": "example glossary",  
"GlossDiv": {  
"title": "S",  
"GlossList": {  
"GlossEntry": {  
"ID": "SGML",  
"SortAs": "SGML",  
"GlossTerm": "Standard Generalized Markup Language",  
"Acronym": "SGML",  
"Abbrev": "ISO 8879:1986",  
"GlossDef": {  
"para": "A meta-markup language, used to create markup languages such as DocBook.",  
"GlossSeeAlso": ["GML", "XML"]  
},  
"GlossSee": "markup"  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 11, 2018, 2:05pm UTC](https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151/2 "2018-09-11T14:05:04Z")

</div>

If you use the json codec with your kafka input I'd expect each message to be treated as a single JSON object.

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [September 11, 2018, 2:15pm UTC](https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151/3 "2018-09-11T14:15:02Z")

</div>

could you share me the json codec code. how your saying i didnt get clearly

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 11, 2018, 4:04pm UTC](https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151/4 "2018-09-11T16:04:28Z")

</div>

Put `codec => json` inside your kafka input.

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [September 11, 2018, 4:15pm UTC](https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151/5 "2018-09-11T16:15:51Z")

</div>

Thanks Manusbeack. 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:** [October 9, 2018, 4:15pm UTC](https://discuss.elastic.co/t/how-json-event-is-consider-while-logstash-processing/148151/6 "2018-10-09T16:15:52Z")

</div>

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