layout | title | categories | published | alias | tags | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
default |
getindices |
|
true |
reference-functions-getindices.html |
|
Prototype: getindices(array)
Return type: slist
Description: Returns a list of keys in array
.
Make sure you specify the correct scope when supplying the name of the variable.
Arguments:
array
: array identifier, in the range[a-zA-Z0-9_$(){}\[\].:]+
Example:
bundle agent example
{
vars:
"v[index_1]" string => "value_1";
"v[index_2]" string => "value_2";
"parameter_name" slist => getindices("v");
reports:
"Found index: $(parameter_name)";
}