Parse user id from s3 and run one id per VU

Hello there,
I downloaded data from S3 via S3Client. Below is the data:

Question: How do I parse those fakeUserMFxxxxxxx out of “data” key and then execute 1 per VU?

export function setup() {
// Download the S3 object containing the test data
const inputObject = s3.getObject(bucketName, testFileKey);
return JSON.stringify(;

export default function (data) {
const ids = JSON.stringify(“/g, “”).split(”\r\n");
console.log(ids[ - 1]);

Hi @alex,

Welcome to the forum :tada:

Unfortunately, I’m not 100% certain I understand what you’re trying to achieve. Could you please clarify a few things so that we avoid misunderstandings? :bowing_man:

What I understood from your description is:

  1. you’re downloading a file from S3 in your setup phase, which contains some user IDs
  2. you parse those ids into an array
  3. you wish to use 1 VU per user-id, and have this VU execute N iterations of a function using exclusively this userID, as in “have VU 1 execute N iterations using UserID 1, have VU 2 execute N iterations using UserID 2, etc…”?

Some more questions that popped up while considering your issue:

  • do you know the number of user IDs beforehand?
  • do you absolutely need to run concurrent requests per-user ID (1 VU matches 1 UserID, or would you be okay with ensuring that a UserID is used at least N times per run?

Let me know :bowing_man: