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:
StudentID|StudentName|StudentGrade
P0172069|StuLast1|A
P0172369|StuLast2|A+
P0172269|StuLast3|B
P0172169|StuLast4|C
Expected Output:
{
StudentID: P0172069
StudentName: StuLast1
StudentGrade: A
StudentID: P0172369
StudentName: StuLast2
StudentGrade: A+
......
}
Code:
//
filter {
mutate {
gsub => ["message","|"," "]
}
grok {
match => ["message","%{WORD:StudentID} %{WORD:StudentName} %{WORD:StudentGrade}" ]
}
}
//