So I have
Filebeat >> Logstash >> ES >> Kibana
I tested the configuration file in logstash without the input beat section
my logstash.conf
input {
stdin {}
beats {
port => 5044
host => "0.0.0.0"
ssl => true
ssl_certificate => "/etc/logstash/logstash.crt"
ssl_key => "/etc/logstash/logstash.key"
}
}
filter{
if [type] == "servers" {
grok {
match => { "message" => 'AV - Alert - "%{INT:id}" --> RID: "%{INT:rule.id.sid}"; RL: "%{INT:rule.alert.level}"; RG: "%{GREEDYDATA:rule.group},"; RC: "%$
add_field => [ "received_at", "%{@timestamp}" ]
} # end grok
date {
match => ["timestamp",
"MMM dd HH:mm:ss",
"MMM d HH:mm:ss",
"MMM dd yyyy HH:mm:ss",
"MMM d yyyy HH:mm:ss"
]
timezone => "Africa/Tunis"
} # date fin
grok {
match => { "ossec_event" => "%{GREEDYDATA:date_ossec} WinEvtLog: %{GREEDYDATA:event}" }
# some log messages does not contain date_ossec => we will use the date of system date
} # end grok
mutate {
rename => ["ossec_event", "message"]
remove_field => ["event"]
} # end mutate
}
}
when I remove the beats {} in input and test the filter there is a timestamp field and it is courrect
Why would changing that option help?
maybe the delay is because of the size .. been tryng to speed up filebeat
The date filter does exactly that but it’s possible that you’ve misconfigured it.
my filebeat.yml
filebeat.prospectors:
#ossim authentication log file
- input_type: log
paths: ["/var/log/auth.log"]
document_type: ossimauthentication
#cisco asa log file
- input_type: log
paths: ["/var/log/cisco-asa.log"]
document_type: ciscoasa
#cisco swithes log file
- input_type: log
paths: ["/var/log/cisco-router.log"]
document_type: ciscoswitches
#ossec log file
- input_type: log
paths: ["/var/ossec/logs/alerts/alerts.log"]
document_type: servers
##----------------------------- Logstash output --------------------------------
output.logstash:
hosts: ["192.200.12.130:5044"]
bulk_max_size : 5144
#Optional SSL. By default is off.
#List of root certificates for HTTPS server verifications
ssl.certificate_authorities: ["/etc/filebeat/logstash.crt"]
#Certificate for SSL client authentication
#ssl.certificate: "/etc/pki/client/cert.pem"
#Client Certificate Key
#ssl.key: "/etc/pki/client/cert.key"
ignore_older: 2h
output.file:
path: "/tmp/filebeat"
filename: filebeat