-
-
Save zzfortezz/67d32de4c478dbbc7949f1e24998c70e to your computer and use it in GitHub Desktop.
Logstash config file for laravel logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
deffua
json { source => "message" enable_metric => false add_field => { "appFeature" => "Subbox" } remove_field => ['@version', 'host'] }