# How combine different data inputs in logstash

**URL:** https://discuss.elastic.co/t/how-combine-different-data-inputs-in-logstash/73997
**Category:** Logstash
**Created:** [February 5, 2017, 11:24pm UTC](https://discuss.elastic.co/t/how-combine-different-data-inputs-in-logstash/73997 "2017-02-05T23:24:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![yoshua](https://avatars.discourse-cdn.com/v4/letter/y/ba9def/32.png) [@yoshua](https://discuss.elastic.co/u/yoshua)
#### Post date: [February 5, 2017, 11:24pm UTC](https://discuss.elastic.co/t/how-combine-different-data-inputs-in-logstash/73997/1 "2017-02-05T23:24:03Z")

</div>

Hello,

I have a set of http API one of them with "no time" data based , the fields are ID, geo location(lat,lon) and others data.

The ID is the key to access another API, (time based) , our target is to send all data from APIs to ES, in each line  
For Example

API ONE respond :

{"dte":[{"id":" **136**","latitud":"-35.760761","longitud":"-71.574215","elevacion":"150"}]}

API2: [http://api2?dteid=](http://api2?dteid=) **136** &user ...... and answer

{"values":[{"val1":"30.5","val2":"33.0"},{"val1":"20.3","val2":"24.4"}..........]

We need leave in ES  
{"id":" **136**","latitud":"-35.760761","longitud":"-71.574215","elevacion":"150","val1":"30.5","val2":"33.0"}  
{"id":" **136**","latitud":"-35.760761","longitud":"-71.574215","elevacion":"150","val1":"20.3","val2":"24.4"}  
...........

Is posible resolve it with logstach or we need join the info before to one file, for example, and then up the file to  
ES.

I hope explain me clearly  
Thanks a lot.

---

<div class="post-metadata">

### Author: ![fbaligand](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fbaligand/32/5657_2.png) [@fbaligand](https://discuss.elastic.co/u/fbaligand)
#### Post date: [February 6, 2017, 12:30pm UTC](https://discuss.elastic.co/t/how-combine-different-data-inputs-in-logstash/73997/2 "2017-02-06T12:30:01Z")

</div>

To my knowledge, with logstash, you can't call a first API, and then call a second API using data returned by first API.

So, to do that, I invite you to use exec input, where you chain curl requests.  
When you receive first response, you extract interesting data to use it into second curl request.

---

<div class="post-metadata">

### Author: ![yoshua](https://avatars.discourse-cdn.com/v4/letter/y/ba9def/32.png) [@yoshua](https://discuss.elastic.co/u/yoshua)
#### Post date: [February 6, 2017, 2:30pm UTC](https://discuss.elastic.co/t/how-combine-different-data-inputs-in-logstash/73997/3 "2017-02-06T14:30:22Z")

</div>

Thanks Fabien,

---

<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: [March 6, 2017, 2:30pm UTC](https://discuss.elastic.co/t/how-combine-different-data-inputs-in-logstash/73997/4 "2017-03-06T14:30:26Z")

</div>

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