related thread about multi-step "for each" loops:
https://community.indeni.com/discussions/topics/45813?page=1
running command:
hawk@Tug:~/tmp/ind/src/checkpoint$ command-runner.sh full-command --ssh indeni,indenirocks123! multitest.ind 192.168.194.41
I'm trying to write a multi-step variable which holds a list of values (an array). I am able to create the variable and retrieve it in the second step, but then I can't seem to access the data in the variable -- it does not "act like" an AWK array. E.g., trying to do this:
for (key in theArr) {
debug(theArr[key])
}
Give me the error:
Description = Failed to compile AWK code of command "a-little-test-script". Code: BEGIN { theArr = dynamic("myarr") debug("** length: " length(theArr))writeComplexMetricString("dummy-metric", null, theArr)
for (key in theArr) {
debug(theArr[key])
}
},
Message = Failed to convert script to tuples. Script:
Interestingly, if I write the variable using writeComplexMetricString(), it succeeds and reports three metrics (the values of the “array”).
I’m guessing that the AWK variable type I’m ending up with in the second step isn’t an associative array, but I can’t figure out what it is. Dumping with writeDebug() “doesn’t work” – it seems to actually crash the script, but there’s no error message…I can’t quite tell what’s going on there…there’s a ton of DEBUG output, and I can see some of the values in the array (but not all), but this is all of the “>>><<< haystack” debug out that I don’t understand at all.