# One or more Inputs to One or more Outputs

**URL:** <https://discuss.elastic.co/t/one-or-more-inputs-to-one-or-more-outputs/171906>\
**Category:** Logstash\
**Created:** [March 12, 2019, 9:34am UTC](https://discuss.elastic.co/t/one-or-more-inputs-to-one-or-more-outputs/171906 "2019-03-12T09:34:07Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 14, 2019, 1:14pm UTC](https://discuss.elastic.co/t/one-or-more-inputs-to-one-or-more-outputs/171906/6 "2019-03-14T13:14:43Z")

</div>

The file input adds a "path" field to the event. If you want to use the same name in a different directory as the output then you could

```
mutate { add_field => { "filename" => "%{path}" } }
mutate { gsub => ["filename", "^.*/", ""] }

```

and then reference that field in the output

```
output { file { path => "/some/path/%{filename}" } }
```

---

_[View the full topic](https://discuss.elastic.co/t/one-or-more-inputs-to-one-or-more-outputs/171906)._
