# Index Json Data in Search using Logstash where data is a value of some key in original Json

**URL:** https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532
**Category:** Logstash
**Created:** [October 23, 2018, 7:06am UTC](https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532 "2018-10-23T07:06:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Panda8](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/panda8/32/69427_2.png) [@Panda8](https://discuss.elastic.co/u/Panda8)
#### Post date: [October 23, 2018, 7:06am UTC](https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532/1 "2018-10-23T07:06:54Z")

</div>

I have a json structure as below

```
{		
	"Name" : "",
	"Type" : "",
	"Document" : {
		"id" : 1,
		"category": "books"
	}

```

}

I want to index only the "Document" part of the Json into Elasticsearch. Is there any way of doing that with Logstash ?

---

<div class="post-metadata">

### Author: ![redX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redx/32/21864_2.png) [@redX](https://discuss.elastic.co/u/redX)
#### Post date: [October 23, 2018, 8:09am UTC](https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532/2 "2018-10-23T08:09:23Z")

</div>

Do some investigation your self. Try some stuff out, and come back with specific questions.  
This is a community driven site. Nobody gets paid here for doing your work.

As a starting point:

- [https://discuss.elastic.co/search?q=logstash%20json](https://discuss.elastic.co/search?q=logstash%20json)
- [https://www.google.com/search?q=logstash+json](https://www.google.com/search?q=logstash+json)

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [October 23, 2018, 8:19am UTC](https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532/3 "2018-10-23T08:19:06Z")

</div>

Determining which fields that are indexed and can be searched can be done by specifying [mappings](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/mapping.html) in an [Elasticsearch index template](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-templates.html). You do not generally control this from Logstash.

---

<div class="post-metadata">

### Author: ![Panda8](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/panda8/32/69427_2.png) [@Panda8](https://discuss.elastic.co/u/Panda8)
#### Post date: [October 23, 2018, 9:07am UTC](https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532/4 "2018-10-23T09:07:12Z")

</div>

The question was posted after thorough investigation on my end and my inability to find any suitable workaround in my case. For future reference When you don't know any answer, try to avoid that post.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 23, 2018, 9:19am UTC](https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532/5 "2018-10-23T09:19:32Z")

</div>

Posts like that do not help anyone. Please be aware of our Code of Conduct for these forums - [https://www.elastic.co/community/codeofconduct](https://www.elastic.co/community/codeofconduct)

---

<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: [November 20, 2018, 9:19am UTC](https://discuss.elastic.co/t/index-json-data-in-search-using-logstash-where-data-is-a-value-of-some-key-in-original-json/153532/6 "2018-11-20T09:19:38Z")

</div>

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