mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2025-12-16 14:07:49 +01:00
27 lines
595 B
Plaintext
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}"
|
|
}
|
|
}
|