We use the AWS cloud route to retrieve data (cloud route events). We used the gem 'aws-sdk-cloudtrail' (version 1.0). According to Cloud Trail, we can get a maximum of 50 results (last time). To get the previous (older) results, we use the "next character" obtained in the previous answer. We do this until we get an empty "next character". When we get an empty token, it means that all the cloud footprint data has been received.
For example: Assume that 100 events are registered in Cloud Trail: In the first api call, we got the last 50 results along with the token to get the next 50 (older than 50). In the second api call, we get the remaining 50 results (older results) along with the next token as nil. This means that there will be no more results.
In our case, we save all the results obtained from the trail in our local database. We repeat this periodically. When you do this a second time (repeating the process explained above), we again get some new and some older results. We repeat the API call again until we get the βnext tokenβ as zero. This results in redundant data that has already been stored in the database during the first cycle. Is there any way to get only a second entry into the event log of the second half.
source
share