# Data isn't indexed by elasticsearch with custom template

**URL:** https://discuss.elastic.co/t/data-isnt-indexed-by-elasticsearch-with-custom-template/91055
**Category:** Elasticsearch
**Created:** [June 28, 2017, 7:31am UTC](https://discuss.elastic.co/t/data-isnt-indexed-by-elasticsearch-with-custom-template/91055 "2017-06-28T07:31:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![logstashisawesome](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@logstashisawesome](https://discuss.elastic.co/u/logstashisawesome)
#### Post date: [June 28, 2017, 7:31am UTC](https://discuss.elastic.co/t/data-isnt-indexed-by-elasticsearch-with-custom-template/91055/1 "2017-06-28T07:31:35Z")

</div>

So i use CURL to send my template to ElasticSearch.

When I then run Logstash (to reindex my data) and view my index there is no data for each record (40,000+) other than the default 4 fields. \_id, \_index, \_type and \_score.

If i view the index data to see the mappings, i can see all of the fields that Logstash sends and the fields from my template.

When i delete the template & index and re-run Logstash my data is displayed perfectly fine but the field types that i set in my template are wrong - as expected.

Logstash version is 5.2.4 and ES version is 5.2.0.

Here is the template i am using.

Thanks in advance.

```
curl - XPUT 'localhost:9200/_template/template?pretty' - H 'Content-Type: application/json' - d '{
	"template": "logstash*",
	"settings": {
		"number_of_shards": 5
	},
	"mappings": {
		"apachelog": {
			"_source": {
				"enabled": false
			},
			"properties": {
				"geoip": {
					"type": "nested",
					"dynamic": true,
					"properties": {
						"ip": {
							"type": "ip"
						},
						"location": {
							"type": "geo_point"
						},
						"latitude": {
							"type": "half_float"
						},
						"longitude": {
							"type": "half_float"
						}
					}
				}
			}
		}
	}
}
'
```

---

<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: [June 28, 2017, 8:17am UTC](https://discuss.elastic.co/t/data-isnt-indexed-by-elasticsearch-with-custom-template/91055/2 "2017-06-28T08:17:16Z")

</div>

> [@logstashisawesome](#):
>
> "\_source": {  
> "enabled": false  
> },

Is this not expected as you have disabled source?

---

<div class="post-metadata">

### Author: ![logstashisawesome](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@logstashisawesome](https://discuss.elastic.co/u/logstashisawesome)
#### Post date: [June 28, 2017, 8:18am UTC](https://discuss.elastic.co/t/data-isnt-indexed-by-elasticsearch-with-custom-template/91055/3 "2017-06-28T08:18:17Z")

</div>

I thought (from the documentation) that source is referring to the 'source' of the data. I.e. the file path to the log file.  
Is this not correct?

---

<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: [June 28, 2017, 8:19am UTC](https://discuss.elastic.co/t/data-isnt-indexed-by-elasticsearch-with-custom-template/91055/4 "2017-06-28T08:19:34Z")

</div>

No, it refers to the JSON document you are indexing. It indexes the fields, so you can still aggregate across it, but does not store the JSON, which prevents you from viewing the data.

---

<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 26, 2017, 8:33am UTC](https://discuss.elastic.co/t/data-isnt-indexed-by-elasticsearch-with-custom-template/91055/5 "2017-07-26T08:33:48Z")

</div>

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