hello everyone please I need your help!
I connected my mailbox to elasticsearch using imap
the problem is that I want to apply grok type filters on
I want to make condtions in my logstash config ie filters type grok ===> if the email comes from this address here is the filter that I will apply to this email
if the email comes from this address here is the filter that I want to apply etc
I made an attempt but I failed ... when I apply the filter I can not find anything at kibana I find the normal message as if I did not apply filters
there is my config file :
input {
imap {
host => "imap.gmail.com"
password => "XXXXXXX"
user => "rouchad767@gmail.com"
port => 993
secure => true
fetch_count => 15
check_interval => 10
strip_attachments => true
folder => "Inbox"
}
}
filter {
if [from] == "abuseorange47@gmail.com" {
grok {
match => { "message" => "%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:receiver}
%{GREEDYDATA:message}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:time_sent}
%{GREEDYDATA:message}
%{CISCO_REASON}%{NOTSPACE}%{SPACE}%{GREEDYDATA:ID}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:localisation}
%{GREEDYDATA:localisation}
%{GREEDYDATA:localisation}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{CISCO_REASON}%{NOTSPACE}%{SPACE}%{GREEDYDATA:name_of_movie}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:name_Director}
%{GREEDYDATA:mission_of_director}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:sender}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:address}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:title_movie}
%{CISCO_REASON}%{NOTSPACE}%{SPACE}%{GREEDYDATA:attack_time}
%{CISCO_REASON}%{NOTSPACE}%{SPACE}%{IP:IP_Adress}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:port}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:Attack_type}
%{CISCO_REASON}%{NOTSPACE}%{SPACE}%{GREEDYDATA:hash}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:file_name}
%{WORD}%{NOTSPACE}%{SPACE}%{GREEDYDATA:file_size}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{SPACE}%{GREEDYDATA:Victim_Company}
%{SPACE}%{GREEDYDATA:Security_Company}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{SPACE}%{GREEDYDATA:phone}
%{SPACE}%{GREEDYDATA:email_security_company}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{SPACE}%{GREEDYDATA:receiver_Company}
%{SPACE}%{GREEDYDATA:email_receiver_company}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}
%{GREEDYDATA:message}" }
}
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
index => "data"
document_type => "email"
hosts => "localhost:9200"
}
}
what i need to do ! please help me