Skip to content

Instantly share code, notes, and snippets.

@nickanderson
Created April 17, 2025 21:08
Show Gist options
  • Save nickanderson/2f0a6e6602e7cf90a9a025e82aab8093 to your computer and use it in GitHub Desktop.
Save nickanderson/2f0a6e6602e7cf90a9a025e82aab8093 to your computer and use it in GitHub Desktop.
variable index for masin
bundle agent __main__
{
  vars:
      "stuff" slist => { "some", "thing-s", "that's", "not valid", "variable names"};

      "classic_associative_array[$(stuff)]"
        string => string_upcase("$(stuff)");
}
# cf-agent --no-lock --log-level info --show-evaluated-vars=default:main\. --file ./example.cf
Variable name                            Variable value                                               Meta tags                                Comment
default:main.classic_associative_array[not valid] NOT VALID                                                    source=promise
default:main.classic_associative_array[some] SOME                                                         source=promise
default:main.classic_associative_array[that's] THAT'S                                                       source=promise
default:main.classic_associative_array[thing-s] THING-S                                                      source=promise
default:main.classic_associative_array[variable names] VARIABLE NAMES                                               source=promise
default:main.stuff                        {"some","thing-s","that's","not valid","variable names"}    source=promise
default:maintain_key_values_meta.tags     {"deprecated=3.6.0","deprecation-reason=Generic reimplementation","replaced-by=set_line_based"} source=promise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment