mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
* Add Logstash configs for filebeat modules Hand transpiled Logstash configs for FB modules to be included in the docs for 5.3. See FB modules for more details: https://github.com/elastic/beats/tree/master/filebeat/module * Fix newlines * Remove multiline, fix bugs
38 lines
1.3 KiB
Text
38 lines
1.3 KiB
Text
input {
|
|
beats {
|
|
# The port to listen on for filebeat connections.
|
|
port => 5044
|
|
# The IP address to listen for filebeat connections.
|
|
host => "0.0.0.0"
|
|
}
|
|
}
|
|
filter {
|
|
grok {
|
|
match => { "message" => ["%{IPORHOST:[nginx][access][remote_ip]} - %{DATA:[nginx][access][user_name]} \[%{HTTPDATE:[nginx][access][time]}\] \"%{WORD:[nginx][access][method]} %{DATA:[nginx][access][url]} HTTP/%{NUMBER:[nginx][access][http_version]}\" %{NUMBER:[nginx][access][response_code]} %{NUMBER:[nginx][access][body_sent][bytes]} \"%{DATA:[nginx][access][referrer]}\" \"%{DATA:[nginx][access][agent]}\""] }
|
|
remove_field => "message"
|
|
}
|
|
mutate {
|
|
rename => { "@timestamp" => "read_timestamp" }
|
|
}
|
|
date {
|
|
match => [ "[nginx][access][time]", "dd/MMM/YYYY:H:m:s Z" ]
|
|
remove_field => "[nginx][access][time]"
|
|
}
|
|
useragent {
|
|
source => "[nginx][access][agent]"
|
|
target => "[nginx][access][user_agent]"
|
|
remove_field => "[nginx][access][agent]"
|
|
}
|
|
geoip {
|
|
source => "[nginx][access][remote_ip]"
|
|
target => "[nginx][access][geoip]"
|
|
}
|
|
}
|
|
output {
|
|
elasticsearch {
|
|
hosts => localhost
|
|
manage_template => false
|
|
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
|
|
document_type => "%{[@metadata][type]}"
|
|
}
|
|
}
|