Hello All,
I need to generate an output file with this basic format:
Heres what I am going to do. I will be looping through a hash with this data structure (this is preliminary, not finalized yet:
Many if the fields are used earlier in my script. What I am interested in for this output file is the $uis_tier (Tier level in the output file), $severity_code (field to the right of Tier, critical, normal etc), $type (one more to the rigt, router, switch server etc.)
I need to build this file dynamically, as in there may be any number of entries for each column as in for $type there could be a router, switch, server, application etc, or just a router and switch. The same is true for each column, the file needs to be built up from left to right as in for each tier level we find, count the number of each severity code, then count the number for that severity code for each type and write all to the output file. The number of rows changes , but the number of columns stays the same.
I am planning on writing all the $uis_tier levels into an array then looping through to see how many different tier levels there are, then put each level in their own array (say @tier1, @tier2 etc.) then looping through the @tier1 array, for each type for that tier level write them into array etc.
At the same time (hopefully), the numbers coresponding to each tier=>criticality=>type will be counted for each column to fill in the numbers.
If anyone has done something similar and can think of a better way (code snippets, modues etc.) it would be appriciated.
Thanks,
Nick
@tier1
@tier2
I got a Biz Degree! How the h*ll did I get here?
I need to generate an output file with this basic format:
Code:
ticket table:
location, priority, devType, startBacklog, opened, closed, endBacklog, total, changes, imBacklog, power, telco
Tier 1, critical, router, 0, 1, 1, 0, 1, 0, 0, 0, 1
Tier 2, critical, router, 0, 22, 21, 1, 22, 2, 1, 11, 8
Tier 2, warning, switch, 0, 3, 3, 0, 3, 2, 0, 1, 0
Tier 2, normal, router, 0, 3, 1, 2, 3, 0, 2, 0, 1
Total, , , 0, 29,26, 3,29, 4, 3, 12, 10
Heres what I am going to do. I will be looping through a hash with this data structure (this is preliminary, not finalized yet:
Code:
$results{$logical_name} = ("$numberprgn, $assignment, $uis_elapsed_start_time, $close_time, $res_anal_code, $user_priority, $severity_code, $type, $subtype, $uis_support_level, $uis_tier, $uis_fstatus");
Many if the fields are used earlier in my script. What I am interested in for this output file is the $uis_tier (Tier level in the output file), $severity_code (field to the right of Tier, critical, normal etc), $type (one more to the rigt, router, switch server etc.)
I need to build this file dynamically, as in there may be any number of entries for each column as in for $type there could be a router, switch, server, application etc, or just a router and switch. The same is true for each column, the file needs to be built up from left to right as in for each tier level we find, count the number of each severity code, then count the number for that severity code for each type and write all to the output file. The number of rows changes , but the number of columns stays the same.
I am planning on writing all the $uis_tier levels into an array then looping through to see how many different tier levels there are, then put each level in their own array (say @tier1, @tier2 etc.) then looping through the @tier1 array, for each type for that tier level write them into array etc.
At the same time (hopefully), the numbers coresponding to each tier=>criticality=>type will be counted for each column to fill in the numbers.
If anyone has done something similar and can think of a better way (code snippets, modues etc.) it would be appriciated.
Thanks,
Nick
@tier1
@tier2
I got a Biz Degree! How the h*ll did I get here?