This is a simple client wrapper for the aws-sdk-cloudwatchlogs
gem.
The idea here is to be able to perform certain queries to know which ips were used by a user on the last X days. This is very useful for fraud detection reasons (so if a user made requests from several ips in a short period of time or some of them are fraudulent, we can do something about it).
The cloudwatch logs flow is simple:
- You run the query, and receive a query_id
- You wait a bit
- After X time you can get the partial results using the query_id
- After Y time the query is over and you get the complete results
This example service populates a field in the user profile, in an admin panel. When the admin needs it, they click on a button to trigger a new query. Queries and their results are cached in redis for X time, so we let the admin know when the check was performed since they probably won't need to run it again for a few days. The info is presented in a "CSV friendly" format so it can be displayed in a table or even exported to