【发布时间】:2019-02-04 02:01:13
【问题描述】:
我正在尝试将警报从 Snort IDS 发送到 Elasticsearch,因此我使用了 3 种技术:
- Elasticsearch-https://pastebin.com/uCNMaZFJ
- Logstash-https://pastebin.com/zgnbbw9K
- Filebeat-https://pastebin.com/45rC3rW5
我的filebeat配置文件里面有这段代码:
input {
beats {
port => 5044
}
} 过滤{
if [type] == "snort" {
# parse the message into individual fields
grok {
match => { "message" => "(?<ts>.*\d{2}:\d{2}:\d{2})\s(?<host>.*?)\s.*?\s\[(?<generator_id>.*?)::(?<signature_id>.*?):.*?\]\s(?<signature>.*?)\s\[Classification:\s(?<classification>.*?)\]\s\[Priority:\s(?<priority>.*?)\].*?{(?<protocol>.*?)\}\s(?<source_ip>.*?):(?<source_port>.*?)\s-\>\s(?<destination_ip>.*?):(?<destination_port>.*)" }
}
# remove the original message if parsing was successful
if !("_grokparsefailure" in [tags]) {
mutate {
remove_field => [ "message" ]
}
}
# parse the timestamp and save in a new datetime field
if [ts] {
date {
match => [ "ts", "MMM dd HH:mm:ss" ]
target => "sys_timestamp"
}
# remove the original timestamp if date parsing was successful
if !("_dateparsefailure" in [tags]) {
mutate {
remove_field => [ "ts" ]
}
}
}
}
} 输出 {
# save events to Elasticsearch with the uuid as the document id
elasticsearch {
hosts => ["localhost:9200"]
manage_template => false
index => "teste-%{+YYYY-MM-dd}"
}
}
当我检查“http://localhost:9200/ola-*/_search?pretty”时,我希望看到 snort 的警报日志,但是没有检索到警报。我正在努力解决这个问题...我不知道是什么问题。
提前致谢!
【问题讨论】:
标签: elasticsearch logstash filebeat snort