Skip to content

Instantly share code, notes, and snippets.

@nickanderson
Created March 14, 2024 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickanderson/72b360d1f61859e0402ae7ba7d4ae725 to your computer and use it in GitHub Desktop.
Save nickanderson/72b360d1f61859e0402ae7ba7d4ae725 to your computer and use it in GitHub Desktop.
select_class example
bundle agent __main__
{
  vars:
    # one option for each of 28 days in a month.
    "options" slist => { expandrange( "selected_option_[1-28]", 1 ) };

  classes:
    "selected_option" select_class => { @(options) };

  reports:
    selected_option::
      "I selected an option";
      "I selected option $(options)"
        if => "$(options)";
}
R: I selected an option
R: I selected option selected_option_15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment