# Using exec and file inputs together

**URL:** https://discuss.elastic.co/t/using-exec-and-file-inputs-together/156959
**Category:** Logstash
**Created:** [November 16, 2018, 1:33am UTC](https://discuss.elastic.co/t/using-exec-and-file-inputs-together/156959 "2018-11-16T01:33:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [November 16, 2018, 1:33am UTC](https://discuss.elastic.co/t/using-exec-and-file-inputs-together/156959/1 "2018-11-16T01:33:39Z")

</div>

Curious if it's possible to use both these inputs in a single pipeline to have a script executed (that saves a file) and then the file input picks up the file? Something like below.

```
input {
  exec {
    command => "d:/script/hulksmash.ps1"
    interval => 300
  }
  file {
    id => "Hulk Smash Data"
    path => "d:/Ingest/HulkSmash/*.txt"
    stat_interval => 60
    start_position => beginning
    close_older => 400
  }
}
```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [November 16, 2018, 3:44am UTC](https://discuss.elastic.co/t/using-exec-and-file-inputs-together/156959/2 "2018-11-16T03:44:17Z")

</div>

You can do it with [https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html](https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html).

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 16, 2018, 6:38am UTC](https://discuss.elastic.co/t/using-exec-and-file-inputs-together/156959/3 "2018-11-16T06:38:38Z")

</div>

The file inpu should not care how a matching file is created so you should be able to use a script called by the exec input plugin to create it.

---

<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 14, 2018, 6:50am UTC](https://discuss.elastic.co/t/using-exec-and-file-inputs-together/156959/4 "2018-12-14T06:50:04Z")

</div>

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