Rails Tutorial 7th Edition

CloudWatch Logs Insights でログにクエリする

CloudWatch Logs Insightsを活用してRDBMS頼りな集計処理を辞めてみる | Skyarch Broadcasting

$ aws logs start-query \
--log-group-name '/test/log' \
--start-time 1625721144 \
--end-time 1625731144 \
--query-string 'fields @timestamp, userID, shopID, price
| stats sum(price) by userID
| sort by userID'
{
    "queryId": "6110a423-15b3-45e2-8477-ae664bdce615"
}
$ aws logs get-query-results
--query-id '6110a423-15b3-45e2-8477-ae664bdce615'