I am in the process trying to change my logstash config from grok to json ... Also Is there a way to have all fields injson to become fields over in kibana, rather than the whole json blob being stuck in the message field? So it can be easy to filter things like level for e.g.
Here is my logstash config:
input {
cloudwatch_logs {
start_position => "end"
log_group => "aws_logs"
log_group_prefix => [ "true" ]
}
}
filter {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601}\t%{UUID:[lambda][request_id]}\t%{GREEDYDATA:message}" }
overwrite => [ "message" ]
tag_on_failure =>
}
grok {
match => { "message" => "(?:START|END) RequestId: %{UUID:[lambda][request_id]}" }
tag_on_failure => []
}
grok {
match => { "message" => "REPORT RequestId: %{UUID:[lambda][request_id]}\tDuration: %{BASE16FLOAT:[lambda][duration]} ms\tBilled Duration: %{BASE16FLOAT:[lambda][billed_duration]} ms \tMemory Size: %{BASE10NUM:[lambda][memory_size]} MB\tMax Memory Used: %{BASE10NUM:[lambda][memory_used]} MB" }
tag_on_failure => []
}
mutate {
convert => {
"[lambda][duration]" => "integer"
"[lambda][billed_duration]" => "integer"
"[lambda][memory_size]" => "integer"
"[lambda][memory_used]" => "integer"
}
}
}
output {
amazon_es {
hosts => ["es-test.amazonaws.com"]
region => "us-east-1"
index => "logs-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}