Splitting multiple strings into subfields

Hi all,
I'm not sure if this is possible or not. I'm collecting a lot of data and collecting it into a single line in a logfile.

For reference, this is the pre-log format

moduleName1
----- InstalledVersion
----- NewVersion
----- Dependencies
---------- Dependency1
-------------pass/fail
-------------versionGT
-------------versionLT

moduleName2
----- InstalledVersion
----- NewVersion
----- Dependencies
---------- DependencyName
-------------pass/fail
-------------versionGT
-------------versionLT
---------- DependencyName
-------------pass/fail
-------------versionGT
-------------versionLT
---------- DependencyName
-------------pass/fail
-------------versionGT
-------------versionLT

Logged results take the following format:

puppet-windowsfeature,3.2.2,3.2.2;puppet-archive,puppet/archive,0.4.4,4.4.0,pass;5.0.0,pass; choria-mcollective_agent_puppet,2.3.2,2.3.3;puppetlabs-stdlib,puppetlabs/stdlib,4.22.0,6.1.0,pass;7.0.0,pass;puppetlabs-stdlib,puppetlabs/stdlib,4.22.0,6.1.0,pass;7.0.0,pass;

So after the first three fields in the source message I have split on a ; to indicate the the start of the dependencies

If there is only one dependency then its easy:
(?<module_name>[^,]*),(?<installed_version>[^,]*),(?<latest_release>[^,]*);%{GREEDYDATA:dependencies}

However, I'd like to create the same fields for each dependency, whether thats dep1_DependencyName, dep1_result, dep2_DependencyName, dep21_result etc.

The idea is to create a dashboard that presents our installed modules, whether there is an update available, and if so, whether dependencies are met.

Thanks,

Dave

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.