# How to define fields in kibana

**URL:** <https://discuss.elastic.co/t/how-to-define-fields-in-kibana/36856>\
**Category:** Logstash\
**Created:** [December 10, 2015, 9:50am UTC](https://discuss.elastic.co/t/how-to-define-fields-in-kibana/36856 "2015-12-10T09:50:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [December 10, 2015, 9:50am UTC](https://discuss.elastic.co/t/how-to-define-fields-in-kibana/36856/1 "2015-12-10T09:50:39Z")

</div>

Hi,

I am using Acconts.json as a data file which is having different fields e.g firstName, lastName ,city etc but I am not able to get the same as different fields in kibana.  
Please suggest how to apply filters to get the data (in logstash config file).

 ![](https://us1.discourse-cdn.com/elastic/original/2X/3/3e873ce47ab611c567ca424352a8ebc3e0b302b0.png)  
Regards,  
Prateek

---

<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:** [December 10, 2015, 10:17am UTC](https://discuss.elastic.co/t/how-to-define-fields-in-kibana/36856/2 "2015-12-10T10:17:01Z")

</div>

This is a Logstash question, not a Kibana question. Please edit your post and change its category.

You need to use the [json codec](https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.htmlhttps://www.elastic.co/guide/en/logstash/current/plugins-codecs-json.html) or [json filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html) to parse the contents of the `message` field as JSON.

---

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [December 11, 2015, 11:39am UTC](https://discuss.elastic.co/t/how-to-define-fields-in-kibana/36856/3 "2015-12-11T11:39:00Z")

</div>

Adding codec =\> "json" within input{} helped to get the fields.

Regards.

---

<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, 5:18am UTC](https://discuss.elastic.co/t/how-to-define-fields-in-kibana/36856/4 "2017-07-06T05:18:54Z")

</div>


