Parsing Text file with Pipe(|) separated fields

I am a newbie and started with Logstash
I have raw text file with data in the below format, with first row as Column headers and following with data separated with Pipe as delimiter.
I was trying to read the data and from file and parse as I needed, but I am getting "Provided Grok patterns do not match data in the input"

File Input:

Expected Output:
StudentID: P0172069
StudentName: StuLast1
StudentGrade: A

StudentID: P0172369
StudentName: StuLast2
StudentGrade: A+

filter {
mutate {
gsub => ["message","|"," "]
grok {
match => ["message","%{WORD:StudentID} %{WORD:StudentName} %{WORD:StudentGrade}" ]

I would suggest using a csv filter

 csv { autodetect_column_names => true separator => '|' }

Thanks Badger, your answer helped me start with a good step forward.
I had to do more changes but yours was the first brick.

Thanks again.

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