Viti
November 21, 2018, 9:30am
1
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
Eniqmatic
(Lewis Barclay)
November 21, 2018, 10:52am
2
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?
Viti
November 21, 2018, 10:57am
3
Yes, I want to output to text file.
My conf file is correct?
Where can I look the persmission?
faulander
(Faulander)
November 21, 2018, 11:02am
4
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.
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
1 Like
Viti
November 21, 2018, 11:20am
6
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.
Viti
November 21, 2018, 12:37pm
7
This is correct, already it works.
Thank you
Great, cheers!!,
mark it as a solution.
Regards,
Balu
system
(system)
Closed
December 19, 2018, 12:39pm
9
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.