AWS SDK NodeJS - Cloudwatch Logs - Usage of Next Token Parameter

113
July 04, 2019, at 9:10 PM

I have a log group named test-group and this has around 100s of log streams within it. I use the following code to extract logs with the JSON property user having the value keet.

let params = {
    logGroupName: 'test-group', /* required */
    filterPattern: '{ $.user = keet }',
    limit: 200
};

It works fine. But the response contains a property called nextToken='xxxxx'.

Question 1: How can I use this next token, to search the rest of the logstreams?

So, I tried the following approach, and it returns more logs, but it does not contain any logs with JSON property user having the value keet

let params = {
    logGroupName: 'test-group', /* required */
    nextToken: "xxxxx"
};

Question 2: Should I use the filterPattern as well with the nextToken as follows?

let params = {
    logGroupName: 'test-group', /* required */
    filterPattern: '{ $.user = keet }',
    limit: 200,
    nextToken: "xxxxx"
};

With this approach, it gives more logs (which are relevant to my original search), by searching more log streams.

Question 3: If I use the above approach, should I be using this recursively, until there is no nextToken in the response?

AWS Documentations do not provide much information on this.

Could someone help me out on this?

READ ALSO
Where should I host my node.js MongoDB API

Where should I host my node.js MongoDB API

I need to create and host a database that a single third party is going to accessI have struggled to find a tutorial on the best way to set up this environment as a whole

140
Delete an embed when a reaction is added

Delete an embed when a reaction is added

What I would like is that at the level of the 'final' embed, when it tells me that the purge has been done, there is a reaction '

148
React Native tutorial: npm install froze

React Native tutorial: npm install froze

I'm trying to follow this tutorial:

167
Why can Truffle not find the suitable configuration file?

Why can Truffle not find the suitable configuration file?

I am simply following the following link: https://blogcofound

268