I Am familiar with Grok and Regexes , I Have the following Logstash Conf file :
Basically it uses the IMAP Plugin in order to read Emails that are sent into the mailbox , As you can see - it tries to parse out (grok) a specific data from the email in order to parse the JSON Part
The Plugin :
input {
imap {
host => "imap.gmail.com"
user => "user@pork.com"
password => "pass"
port => 993
secure => true
fetch_count => 100
check_interval => 10
}
}
#Grokking the Message #
filter {
grok {
#match => {"message" => "Full Response\:\\n%{GREEDYDATA:json}\}"}
match => {"message" => "Full Response: %{GREEDYDATA:json}\}"}
#match => {"message" => "(?<json>Full Response:\\n(.|\r|\n)*)"}
break_on_match => false
}
json { source => "json"
add_tag => "Parsed"
}
output {
file {
path => "/tmp/emailtmp.log"
}
stdout {
codec => rubydebug }
}
For some reason i keep recieving __grokparsefailure and the JSON is , ofcourse , not parsed - I Only need the JSON Part (After the Full Response)
Tried various ways , any idea ?
Thanks!