我在 S3 存储桶中有 AWS Lambda 和 API 网关日志,我托管了 logstash 并将日志从 s3 移动到 elasticsearch 服务以集中日志记录。我想在logstash中过滤Lambda和api网关的日志,所以在弹性搜索中我可以很容易地找到东西。
下面是我在 kibana“消息”字段中获取并想要过滤的 apigateway 日志
{"messageType":"DATA_MESSAGE",
"owner":"",
"logGroup":"API-Gateway-Execution-Logs/live",
"logStream":"d645920e395fe","subscriptionFilters":["API-Gateway-Execution-Logslive"],
"logEvents":[{"id":"3463","timestamp":1553,"message":"(d7b307ed-4c36-11e9) Extended Request Id: W6ghjgj"}]
}
filter i tried with
filter {
grok {
match => { "message" => "%{GREEDYDATA:wd}" }
}
json{
source => "wd"
target => "js"
}
mutate {
add_field => { "t1" => "%{[js][logEvents][message]}"}
}
}