mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2025-12-16 05:57:48 +01:00
31 lines
684 B
Plaintext
31 lines
684 B
Plaintext
input {
|
|
file {
|
|
path => "/var/lib/docker/containers/*/*.log"
|
|
start_position => "beginning"
|
|
sincedb_path => "/dev/null"
|
|
type => "docker"
|
|
codec => "json"
|
|
}
|
|
}
|
|
|
|
filter {
|
|
if [log_message] =~ /GET/ {
|
|
grok {
|
|
match => { "log_message" => "%{IP:client_ip} - - \[%{HTTPDATE:timestamp}\] \"%{WORD:method} %{URIPATH:request_path} HTTP/%{NUMBER:http_version}\" %{NUMBER:response_code} %{NUMBER:response_size}" }
|
|
}
|
|
date {
|
|
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
|
|
target => "@timestamp"
|
|
}
|
|
}
|
|
}
|
|
|
|
output {
|
|
elasticsearch {
|
|
hosts => ["http://es01:9200"]
|
|
index => "docker-logs-%{+YYYY.MM.dd}"
|
|
user=> "${ELASTIC_USER}"
|
|
password=> "${ELASTIC_PASSWORD}"
|
|
}
|
|
}
|