# Create several es type from one json input

**URL:** <https://discuss.elastic.co/t/create-several-es-type-from-one-json-input/124473>\
**Category:** Logstash\
**Created:** [March 19, 2018, 1:53am UTC](https://discuss.elastic.co/t/create-several-es-type-from-one-json-input/124473 "2018-03-19T01:53:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viven7512](https://avatars.discourse-cdn.com/v4/letter/v/c67d28/32.png) [@Viven7512](https://discuss.elastic.co/u/Viven7512)\
**Post date:** [March 19, 2018, 1:53am UTC](https://discuss.elastic.co/t/create-several-es-type-from-one-json-input/124473/1 "2018-03-19T01:53:34Z")

</div>

I have a json input :

> [  
> {  
> "fields": {  
> "last\_reported": 1519897717,  
> "is\_returning": 1,  
> "numbikesavailable": 4,  
> "numdocksavailable": 25,  
> "lon": 2.275342586850291,  
> "lat": 48.8296843300915,  
> "is\_installed": 1,  
> "is\_renting": 1,  
> "station\_id": 7234,  
> "name": "Colonel Pierre Avia",  
> "capacity": 31,  
> "xy": [  
> 48.8296843301,  
> 2.27534258685  
> ]  
> },  
> "geometry": {  
> "type": "Point",  
> "coordinates": [  
> 2.27534258685,  
> 48.8296843301  
> ]  
> },  
> "record\_timestamp": "2018-03-19T00:16:33+00:00",  
> "recordid": "e9a4f7a8874ba8dd9b3d004640d99759b3683005"  
> },  
> {  
> "fields": {  
> "last\_reported": 1519897923,  
> "is\_renting": 0,  
> "is\_returning": 0,  
> "numbikesavailable": 26,  
> "station\_id": 54000632,  
> "numdocksavailable": 10,  
> "is\_installed": 0  
> },  
> "record\_timestamp": "2018-03-19T00:16:33+00:00",  
> "recordid": "2488a7afe3c524c4901f698559aff4c275788473"  
> },  
> {  
> "fields": {  
> "last\_reported": 1519897673,  
> "is\_renting": 1,  
> "is\_returning": 1,  
> "numbikesavailable": 12,  
> "station\_id": 43195240,  
> "numdocksavailable": 14,  
> "is\_installed": 1  
> },  
> "record\_timestamp": "2018-03-19T00:16:33+00:00",  
> "recordid": "c7612546f11a48e5b2e3350a2497b63f55a0903d"  
> },  
> {  
> "fields": {  
> "last\_reported": 1519748094,  
> "is\_renting": 1,  
> "is\_returning": 1,  
> "numbikesavailable": 18,  
> "station\_id": 35101194,  
> "numdocksavailable": 12,  
> "is\_installed": 1  
> },  
> "record\_timestamp": "2018-03-19T00:16:33+00:00",  
> "recordid": "b6f9a4018750a289155f4b4a3e3385e094abf0e7"  
> }  
> ]

I want to split this input and create one type wihch would have the name of a field for each item of source array .

---

<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:** [March 19, 2018, 6:39pm UTC](https://discuss.elastic.co/t/create-several-es-type-from-one-json-input/124473/2 "2018-03-19T18:39:18Z")

</div>

It would be easier to understand if you gave an example.

---

<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:** [April 16, 2018, 6:39pm UTC](https://discuss.elastic.co/t/create-several-es-type-from-one-json-input/124473/3 "2018-04-16T18:39:24Z")

</div>

Closed on April 16, 2018, 6:39pm UTC

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