Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
Created November 11, 2014 14:32
Show Gist options
  • Select an option

  • Save neilhwatson/a14ed62315b5f9f96407 to your computer and use it in GitHub Desktop.

Select an option

Save neilhwatson/a14ed62315b5f9f96407 to your computer and use it in GitHub Desktop.
body common control
{
bundlesequence => {
"main",
};
}
bundle agent main
{
vars:
"a[0][class]" string => "any";
"a[0][command]" string => "/bin/true";
"a[1][class]" string => "linux";
"a[1][command]" string => "/bin/false";
"m" data => mergedata( a );
"i" slist => getindices( m );
reports:
"i => [${i}]";
"class => ${m[${i}][class]}";
"command => ${m[${i}][command]}";
}
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./merge.cf
R: class => ${cf_null}
R: command => ${cf_null}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment