ft_transcendence/logstash.conf
2024-07-31 13:44:44 +02:00

27 lines
595 B
Plaintext

input {
stdin { }
}
filter {
grok {
match => {
"message" => '%{IP:client_ip} - - \[%{HTTPDATE:timestamp}\] "%{WORD:http_method} %{URIPATH:request_path}" %{NUMBER:http_status_code} %{NUMBER:response_size}'
}
# Optional: add a tag to the event for easier identification
add_tag => ["parsed_log"]
}
# Optionally, convert the timestamp to the Logstash @timestamp
date {
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
target => "@timestamp"
}
}
output {
elasticsearch {
hosts => ["http://es01:9200"]
index => "logstash-%{+YYYY.MM.dd}"
}
}