# Possible to parse the message in Logstash and build indexes/fields from it

**URL:** https://discuss.elastic.co/t/possible-to-parse-the-message-in-logstash-and-build-indexes-fields-from-it/53058
**Category:** Logstash
**Created:** [June 16, 2016, 9:00pm UTC](https://discuss.elastic.co/t/possible-to-parse-the-message-in-logstash-and-build-indexes-fields-from-it/53058 "2016-06-16T21:00:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kasi](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@kasi](https://discuss.elastic.co/u/kasi)
#### Post date: [June 16, 2016, 9:00pm UTC](https://discuss.elastic.co/t/possible-to-parse-the-message-in-logstash-and-build-indexes-fields-from-it/53058/1 "2016-06-16T21:00:51Z")

</div>

We have JSON messages that are getting forwarded to LogStash from filebeat, We would like to  
parse the JSON messages and convert them into fields and add them as part of the message and would  
also like to create index based on the fields in Elastic Search, is it possible?

Thanks,

Kasi

---

<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: [June 17, 2016, 5:32am UTC](https://discuss.elastic.co/t/possible-to-parse-the-message-in-logstash-and-build-indexes-fields-from-it/53058/2 "2016-06-17T05:32:24Z")

</div>

Yes, set `codec => json` for your beats input to have the payload deserialized as JSON.

---

<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: [July 6, 2017, 4:52am UTC](https://discuss.elastic.co/t/possible-to-parse-the-message-in-logstash-and-build-indexes-fields-from-it/53058/3 "2017-07-06T04:52:23Z")

</div>


