Currently I am developing an application where I need to retrieve only "ERROR" related logs and put them to elasticsearch index.
Here is my sample log:
2018-07-05 19:37:15,888 [6] ERROR <Description> - Error while ProcessRequest, Level: ERROR
I am bit confused about this. Should I use particular grok pattern in filter or I can handle this in input itself?
This is my current logstash pipeline configuration:
input{
file{
path => "D:\ELK_Info\APEXDataService.log"
start_position => "beginning"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
}
output {
if[LEVEL] == "ERROR"
http {
url => "http://localhost:9200/indexName/log"
http_method => "post"
format => "json"
}
}
I have added multi line codec in my input.
So my question is, how may I filter this to get all the data of my log related to ERROR to my output?