I have an output file that has hosts and lists of NFS share sources per hosts.
I need to produce a list of hosts per NFS share. So I think it will be a hash of arrays with they keys being the share names?
here is a snippet of the data:
ok: [cgva1lbpmor001m] => { "result.stdout_lines": [ "SOURCE FSTYPE SIZE USED AVAIL USE% TA +RGET", "kmhpemcfspa21:/oracle_depot nfs 130.1G 77.2G 52.9G 59% /e +xport/oracle", "kmhpemcfspa21:/oracle_dump nfs 11.5T 1.8T 9.7T 16% /e +xport/oracle_dump" ] }
I can easily create the hash of shares but not sure how to seek back up once a share is found and add the host to an array and add to the hash
This is all I have, I am stuck.
my $export; my %exports; open(OUT, "<", "$OUTF") or die "cant open file: $!"; while ( my $line = <OUT>) { next unless $line =~ /nfs/; chomp $line; ($export = $line) =~ s/\s+"(.*)\s+nfs.*/$1/; $export =~ s/\s+//g; $exports{$export} = 1; }
Thanks for any help
In reply to File Parsing Question by neptuna
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |