# Input from file output to file

**URL:** <https://discuss.elastic.co/t/input-from-file-output-to-file/157664>\
**Category:** Logstash\
**Created:** [November 21, 2018, 9:30am UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664 "2018-11-21T09:30:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viti](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@Viti](https://discuss.elastic.co/u/Viti)\
**Post date:** [November 21, 2018, 9:30am UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/1 "2018-11-21T09:30:50Z")

</div>

Hi, I want to take a file log and process the data to other output file.

I thinck than it's a easy proccedure, but my code don´t work ☹

it's my first time with logstash. Sorry if the ask is very obvius.

My file log:  
MODSEN:001#I:216F6F057C105410#TS:Tue, 11/11/18, 16:18:0#BAT:11#TCA:59.99#HUMA:69#PA:1020#ANE:6.7#PLUV:1.25#DIR:100#US:9.99#GPS\_LAT:-34.638112#GPS\_LNG:-68.397158  
MODSEN:002#I:316F6F057C105410#TS:Tue, 15/12/18, 16:20:1#BAT:51#TCA:39.99#HUMA:79#PA:1020#ANE:6.7#PLUV:5.23#DIR:100#US:9.99#GPS\_LAT:-14.638112#GPS\_LNG:-98.397158  
MODSEN:003#I:416F6F057C105510#TS:Tue, 13/01/18, 16:22:0#BAT:61#TCA:29.99#HUMA:89#PA:1020#ANE:6.7#PLUV:1.32#DIR:100#US:9.99#GPS\_LAT:-24.638112#GPS\_LNG:-48.397158

my conf file:  
input {  
file {  
path =\> "C:\Users\001\Desktop\logs\input.log"  
start\_position =\> "beginning"  
sincedb\_path =\> "NUL"  
}  
}

filter {  
kv {  
field\_split =\> "#"  
value\_split =\> ":"  
}  
}  
output {  
file {  
path =\> "C:\Users\001\Desktop\logs\output.txt"  
}  
}

somebody can help me?

Thank you very much

---

<div class="post-metadata">

**Author:** ![Eniqmatic](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Eniqmatic](https://discuss.elastic.co/u/Eniqmatic)\
**Post date:** [November 21, 2018, 10:52am UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/2 "2018-11-21T10:52:13Z")

</div>

So you want to output to a text file? What is the error you are getting in the logstash log? Does the logstash process have permission to write to that location?

---

<div class="post-metadata">

**Author:** ![Viti](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@Viti](https://discuss.elastic.co/u/Viti)\
**Post date:** [November 21, 2018, 10:57am UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/3 "2018-11-21T10:57:29Z")

</div>

Yes, I want to output to text file.

My conf file is correct?

Where can I look the persmission?

---

<div class="post-metadata">

**Author:** ![faulander](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/faulander/32/36344_2.png) [@faulander](https://discuss.elastic.co/u/faulander)\
**Post date:** [November 21, 2018, 11:02am UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/4 "2018-11-21T11:02:05Z")

</div>

Viti, i presume you're running logstash on windows?  
Can you try to output to console to see if it process the logs correctly?

Which user you're running logstash with?  
check the permissions of the destination file if the user you're running logstash with has write permissions.

---

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [November 21, 2018, 11:11am UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/5 "2018-11-21T11:11:35Z")

</div>

Hello @Viti,

After checking your input code ,oberved that you need to change path:  
path =\> "C:\Users\001\Desktop\logs\input.log"

to

path =\> "C:/Users/001/Desktop/logs/input.log"

Make sure tou apply the change at the output also.

Regards,  
Balu

---

<div class="post-metadata">

**Author:** ![Viti](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@Viti](https://discuss.elastic.co/u/Viti)\
**Post date:** [November 21, 2018, 11:20am UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/6 "2018-11-21T11:20:16Z")

</div>

Yes, I'm in windows.

I'm doing this steps:  
1 run cmd  
2 cd logstash/bin  
3 logstash.bat -f prueba.conf

Mi user has permissions of admin

Do I need to do anything command more for my file prueba.conf ?

I want to get the data of file input.log and writes in file output.txt

How can I do this.

---

<div class="post-metadata">

**Author:** ![Viti](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@Viti](https://discuss.elastic.co/u/Viti)\
**Post date:** [November 21, 2018, 12:37pm UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/7 "2018-11-21T12:37:08Z")

</div>

> [@balumurari1](#):
>
> path =\> "C:/Users/001/Desktop/logs/input.log"

This is correct, already it works.

Thank you

---

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [November 21, 2018, 12:39pm UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/8 "2018-11-21T12:39:32Z")

</div>

Great, cheers!!,  
mark it as a solution.

Regards,  
Balu

---

<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 19, 2018, 12:39pm UTC](https://discuss.elastic.co/t/input-from-file-output-to-file/157664/9 "2018-12-19T12:39:38Z")

</div>

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