-
Type:
Story
-
Status: Done
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.10.0
-
Component/s: None
-
Labels:None
Today getting the values out of variables based on the return of variablesmatching is tricky and error prone.
Here is an example based on data containers
https://gist.github.com/neilhwatson/da3176a83d397600bfca
Trying to construct a classic array where the index is the value of the found variables results in a programming error (noted in #7254
<pre>
body common control
{
bundlesequence =>
;
}
bundle agent any
{
vars:
"open_ports" slist =>
;
}
bundle agent apache
{
vars:
"open_ports" slist =>
;
}
bundle agent iptables
{
vars:
"port_list" slist => variablesmatching(".*open_ports");
"port_array[$($(port_list))]" string => "1";
}
</pre>
Getting the values of the variables that you found is a logical next step and I think we should make it easier.
Perhaps a new function to getvaluesfromvariablesmatching() that returns a list of all values.
Additionally being able to getvalues/indices from a list of lists could ease this.
- relates to
-
CFE-2265 Add variablesmatching_as_data function
-
- Done
-