mrras25 has asked for the wisdom of the Perl Monks concerning the following question:
I need help putting the output of a command into a hash of hashes. The problem is that each "Name" in the output is different but contained in that name out their could be multiple "keys" for the value I am trying to capture
I want to capture the "Name" and the unique 1st key identifier, and then each of the following key and value pair (CloneCount, CloneCount,CloneState,IsDirty, PercentSynced) As you can see from below some names have multiple cloneID and values associated with that cloneID
Here is the output its just a sample of the output:
Name: LUN 120 DB CloneGroupUid: 50:06:01:60:BC:E0:26:09:03:00:00:00:00:00:00:00 InSync: Yes Description: QuiesceThreshold: 60 SourceMediaFailure: No IsControllingSP: Yes SourceLUNSize: 587202560 CloneCount: 3 Sources: 120 Clones: CloneID: 0100000000000000 CloneState: Consistent CloneCondition: Administratively Fractured AvailableForIO: Yes CloneMediaFailure: No IsDirty: No PercentSynced: N/A RecoveryPolicy: Auto SyncRate: High CloneLUNs: 200 UseProtectedRestore: No IsFractured: Yes CloneID: 0300000000000000 CloneState: Consistent CloneCondition: Normal AvailableForIO: No CloneMediaFailure: No IsDirty: No PercentSynced: N/A RecoveryPolicy: Auto SyncRate: Medium CloneLUNs: 202 UseProtectedRestore: No IsFractured: No CloneID: 0200000000000000 CloneState: Consistent CloneCondition: Administratively Fractured AvailableForIO: Yes CloneMediaFailure: No IsDirty: No PercentSynced: N/A RecoveryPolicy: Auto SyncRate: High CloneLUNs: 201 UseProtectedRestore: No IsFractured: Yes Name: LUN 110 audit trail CloneGroupUid: 50:06:01:60:BC:E0:26:09:08:00:00:00:00:00:00:00 InSync: Yes Description: QuiesceThreshold: 60 SourceMediaFailure: No IsControllingSP: Yes SourceLUNSize: 629145600 CloneCount: 1 Sources: 110 Clones: CloneID: 0100000000000000 CloneState: Consistent CloneCondition: Administratively Fractured AvailableForIO: Yes CloneMediaFailure: No IsDirty: No PercentSynced: N/A RecoveryPolicy: Auto SyncRate: High CloneLUNs: 213 UseProtectedRestore: No IsFractured: Yes
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Command output into a hash of hash
by colwellj (Monk) on Nov 20, 2009 at 00:31 UTC | |
by mrras25 (Acolyte) on Nov 20, 2009 at 00:46 UTC | |
|
Re: Command output into a hash of hash
by toolic (Bishop) on Nov 20, 2009 at 00:27 UTC | |
by mrras25 (Acolyte) on Nov 20, 2009 at 00:34 UTC | |
|
Re: Command output into a hash of hash
by bichonfrise74 (Vicar) on Nov 20, 2009 at 01:05 UTC |