Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 748 Bytes

getindices.markdown

File metadata and controls

39 lines (28 loc) · 748 Bytes
layout title categories published alias tags
default
getindices
Reference
Functions
getindices
true
reference-functions-getindices.html
reference
data functions
functions
getindices

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)";
    }