# Logstash Getting Filename and Writing to that file

**URL:** <https://discuss.elastic.co/t/logstash-getting-filename-and-writing-to-that-file/101649>\
**Category:** Logstash\
**Created:** [September 25, 2017, 7:19am UTC](https://discuss.elastic.co/t/logstash-getting-filename-and-writing-to-that-file/101649 "2017-09-25T07:19:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranjith](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@ranjith](https://discuss.elastic.co/u/ranjith)\
**Post date:** [September 25, 2017, 7:19am UTC](https://discuss.elastic.co/t/logstash-getting-filename-and-writing-to-that-file/101649/1 "2017-09-25T07:19:55Z")

</div>

Hello all,

I am new to Logstash can anyone help me for the following scenario.  
Is it possible to get filename and store it in the variable and processing the different files and storing it in the filename which we already stored in a variable.

For eg: 1. To get the filename in the X - location .  
2. To process the files in the Y - location.  
3. Storing the processed files in the X-location filename.

---

<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:** [October 23, 2017, 7:20am UTC](https://discuss.elastic.co/t/logstash-getting-filename-and-writing-to-that-file/101649/2 "2017-10-23T07:20:08Z")

</div>

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