# Multiple pipeline pattern for REST API

**URL:** https://discuss.elastic.co/t/multiple-pipeline-pattern-for-rest-api/174094
**Category:** Logstash
**Created:** [March 27, 2019, 10:39am UTC](https://discuss.elastic.co/t/multiple-pipeline-pattern-for-rest-api/174094 "2019-03-27T10:39:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sackey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sackey/32/42860_2.png) [@Sackey](https://discuss.elastic.co/u/Sackey)
#### Post date: [March 27, 2019, 10:39am UTC](https://discuss.elastic.co/t/multiple-pipeline-pattern-for-rest-api/174094/1 "2019-03-27T10:39:49Z")

</div>

Good day.  
I try to achieve this pattern using Logstash and pipelines.

 ![Pattern%20V2](https://us1.discourse-cdn.com/elastic/original/3X/a/e/aef31676ee533f3970f7f4fed67ac0168289d5f3.png)

```
# Auth
- pipeline.id: api-getToken
  path.config: "api-getToken.conf"

# Count of pages
- pipeline.id: api-getPages
  path.config: "api-getPages.conf"

# Fetch data for a specified page
- pipeline.id: api-getData
  path.config: "api-getData.conf"

```

Here is my auth config:

```
input {
    exec {
        command => "app-auth"
        schedule => "" # Every k days
    }
}

output {
    pipeline { send_to => tokenEvt }
}

```

And my getPages config :

```
input {
    pipeline {
        address => tokenEvt
        http_poller => { ... }
    }
}

output {
    pipeline { send_to => dataEvt }
}

```

This is a wrong pattern, probably because I try to use pipeline logic as an event trigger. Moreover, somes issues will probably occure by the necessity to declare the "schedule" property for the http\_poller plugin.

All in all, I would know if what I'm trying to do is possible using logstash. If not, what is the best way to achieve that ? Generate all my data files from another process and then use logstash to push them in ES ? Or even generate all my data from a batch or powershell script used as an Logstash exec input and then push the output in ES ?

Thanks in advance for your suggestions.

---

<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 24, 2019, 10:39am UTC](https://discuss.elastic.co/t/multiple-pipeline-pattern-for-rest-api/174094/2 "2019-04-24T10:39:53Z")

</div>

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