Add Instance ID to logs

This will parse the logs and grab the instance ID out of it.

Change-Id: I9ad0c0e8d6101cca1fc3c4a7cb5cabc3504e6e28
This commit is contained in:
Mohammed Naser 2018-09-27 14:56:52 -04:00
parent aa647953e0
commit 4f03c51118

View File

@ -195,6 +195,14 @@
remove_field => [ "logdate" ]
}
if "nova" in [tags] {
# Instance ID from logs (i.e. "[instance: 5ee83c6e-3604-467a-be54-e48429086e3f]")
grok {
match => {
"logmessage" => ["(\[instance\: %{NOTSPACE:instance_id}\] )?%{GREEDYDATA:logmessage}?"]
}
overwrite => [ "logmessage" ]
}
if [module] == "nova.api.openstack.requestlog" {
grok {
match => { "logmessage" => "%{IPORHOST:client_ip} \"%{WORD:verb} %{NOTSPACE:request}\" status\: %{NUMBER:response} len\: %{NUMBER:bytes} microversion\: %{NUMBER:microversion} time\: %{NUMBER:duration:float}" }