Skip to content

Instantly share code, notes, and snippets.

@zzfortezz
Forked from jiromm/laravel.conf
Created March 15, 2023 18:36
Show Gist options
  • Save zzfortezz/67d32de4c478dbbc7949f1e24998c70e to your computer and use it in GitHub Desktop.
Save zzfortezz/67d32de4c478dbbc7949f1e24998c70e to your computer and use it in GitHub Desktop.
Logstash config file for laravel logs
input {
file {
path => "/var/www/laravel-project/storage/logs/laravel.log"
codec => multiline {
pattern => "^\[%{TIMESTAMP_ISO8601:timestamp}\]"
what => "previous"
negate => true
}
}
}
filter {
grok {
match => {
"message" => "\[%{TIMESTAMP_ISO8601:timestamp}\] %{DATA:env}\.%{DATA:severity}: (?<log>[^{]+)?%{GREEDYDATA:raw-json}"
}
}
json {
source => "raw-json"
target => "json"
}
mutate {
rename => { "message" => "raw-message" }
rename => { "json" => "raw-json" }
}
}
output {
elasticsearch {
hosts => "127.0.0.1:9200"
user => "user"
password => "pass"
index => "laravel-logs"
}
}
@zzfortezz
Copy link
Author

deffua
json { source => "message" enable_metric => false add_field => { "appFeature" => "Subbox" } remove_field => ['@version', 'host'] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment