# Index template resulting in missing all fields in kibana

**URL:** <https://discuss.elastic.co/t/index-template-resulting-in-missing-all-fields-in-kibana/232601>\
**Category:** Elasticsearch\
**Created:** [May 14, 2020, 9:32am UTC](https://discuss.elastic.co/t/index-template-resulting-in-missing-all-fields-in-kibana/232601 "2020-05-14T09:32:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deny7](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@Deny7](https://discuss.elastic.co/u/Deny7)\
**Post date:** [May 14, 2020, 9:32am UTC](https://discuss.elastic.co/t/index-template-resulting-in-missing-all-fields-in-kibana/232601/1 "2020-05-14T09:32:19Z")

</div>

Hi, I defined template on existing index. But when the template is applied on index creation, all fields dissapear in kibana. I cant see any error in logs. Without template defined its showing data. Can anybody help?

Kibana:

 ![pic](https://us1.discourse-cdn.com/elastic/original/3X/7/7/77a16a6657cf47c9c98fd4b580ea7bf80e209ee7.png)

My template:

```
PUT _template/test-temp
{
   "index_patterns":[
      "test-temp-access*"
   ],
   "settings":{
      "number_of_shards":2
   },
   "mappings":{
      "_source":{
         "enabled":false
      },
      "properties":{
         "@timestamp":{
            "type":"date"
         },
         "created_at":{
            "type":"date",
            "format":"EEE MMM dd HH:mm:ss Z yyyy"
         },
         "bytes":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "client":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "client2":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "duration":{
            "type":"long"
         },
         "host":{
            "properties":{
               "architecture":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "hostname":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "name":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "os":{
                  "properties":{
                     "codename":{
                        "type":"text",
                        "fields":{
                           "keyword":{
                              "type":"keyword",
                              "ignore_above":256
                           }
                        }
                     },
                     "platform":{
                        "type":"text",
                        "fields":{
                           "keyword":{
                              "type":"keyword",
                              "ignore_above":256
                           }
                        }
                     }
                  }
               }
            }
         },
         "email":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "email2":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "http_method":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "http_version":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "message":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "referrer":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "remote_ip":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "response_code":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "tags":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "url":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "user_name":{
            "type":"text",
            "fields":{
               "keyword":{
                  "type":"keyword",
                  "ignore_above":256
               }
            }
         },
         "geoip":{
            "properties":{
               "city_name":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "continent_code":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "country_code2":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "country_code3":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "country_name":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "dma_code":{
                  "type":"long"
               },
               "ip":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "latitude":{
                  "type":"float"
               },
               "location":{
                  "properties":{
                     "lat":{
                        "type":"float"
                     },
                     "lon":{
                        "type":"float"
                     }
                  }
               },
               "longitude":{
                  "type":"float"
               },
               "postal_code":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "region_code":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "region_name":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               },
               "timezone":{
                  "type":"text",
                  "fields":{
                     "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                     }
                  }
               }
            }
         }
      }
   }
}

```

Logstash conf:

```
	else if([fields][log_type] == "test-temp-access") {
          	grok {
                patterns_dir => ["/etc/logstash/patterns"]
				break_on_match => false
                match => ["message", "%{test-temp-access}"]
				remove_tag => ["_grokparsefailure"]
          	}
          	date{
                  	match => ["timestamp", "dd/MMM/yyyy:HH:mm:ss +SSSS"]
                  	target => "timestamp_from_log"
          	}
			geoip {
                source => "client"
          	}
          	mutate {
                  	replace => {"[type]" => "test-temp-access"}
          	}

```

Grok Pattern:

`%{IP:client}, %{IP:client2} - "%{DATA:email}" "%{DATA:email2}" \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{URIPATHPARAM:request} HTTP/%{NUMBER:httpversion}\" %{INT:status} %{NUMBER:bytes} "%{DATA:url}" "%{DATA:agent}" %{NUMBER:duration}`

---

<div class="post-metadata">

**Author:** ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)\
**Post date:** [May 14, 2020, 11:12am UTC](https://discuss.elastic.co/t/index-template-resulting-in-missing-all-fields-in-kibana/232601/2 "2020-05-14T11:12:57Z")

</div>

I guess you should try with \_source _not_ disabled, i.e. remove

```auto
      "_source":{
         "enabled":false
      }

```

from mapping.

---

<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:** [June 11, 2020, 11:13am UTC](https://discuss.elastic.co/t/index-template-resulting-in-missing-all-fields-in-kibana/232601/3 "2020-06-11T11:13:07Z")

</div>

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