# Multiline flat json log file to nested json in Elasticsearch

**URL:** <https://discuss.elastic.co/t/multiline-flat-json-log-file-to-nested-json-in-elasticsearch/155625>\
**Category:** Logstash\
**Created:** [November 6, 2018, 8:59pm UTC](https://discuss.elastic.co/t/multiline-flat-json-log-file-to-nested-json-in-elasticsearch/155625 "2018-11-06T20:59:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![psk](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@psk](https://discuss.elastic.co/u/psk)\
**Post date:** [November 6, 2018, 8:59pm UTC](https://discuss.elastic.co/t/multiline-flat-json-log-file-to-nested-json-in-elasticsearch/155625/1 "2018-11-06T20:59:46Z")

</div>

I have a multiline json log file , which flat .but my template in the Elastic search has nested fields . i am using logstash to send to elastic search .  
ex  
my log file  
{"appname":"test1","level":"1","version":"v1"}  
{"appname":"test2","level":"1","version":"v1"}

my template  
{  
"application": {  
"properties": {  
"name": {  
"type": "text"  
},  
"version": {  
"type": "text"  
},  
"level": {  
"type": "keyword"  
}  
}  
}

---

<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:** [December 4, 2018, 8:59pm UTC](https://discuss.elastic.co/t/multiline-flat-json-log-file-to-nested-json-in-elasticsearch/155625/2 "2018-12-04T20:59:58Z")

</div>

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