Hi Monks,

Good day...!!

I am having a status log file which keeps a track of previous script run. As per requirement, need to compare the current run to the previous run and subsequently sends out notification alerts.

The status file content is build like a reference tree as below:

FreeTablespace_Status.log

$ref = { 'servername.com' => { 'DB01.com' => { 'TableSpace +' => { ' +Tablespace_Name' => { + 'OK' => 1, + 'Node' => 'servername.com', + 'Description' => 'Table Space threshold less th +an 90%', + 'UniqueID' => '12345667', + 'Severity' => 'Normal', + 'Title' => 'Servername table space threshold is + less' + }, ' +Tablespace_02' => { + 'OK' => 1, + 'Node' => 'servername.com', + 'Description' => 'Table Space threshold less than +90%', + 'UniqueID' => '3452555', + 'Severity' => 'Normal', + 'Title' => 'Servername-> tablespace02 threshold is + less' + } + } } }, 'servername02.com' => { 'DB02.com' => { 'TableSpace +' => { ' +Tablespace_01' => { + 'OK' => 1, + 'Node' => 'servername02.com', + 'Description' => 'Table Space threshold less th +an 90%', + 'UniqueID' => '0985433', + 'Severity' => 'Critical', + 'Title' => 'servername02 tablespace01 threshold + is less' + }, ' +Tablespace_02' => { + 'OK' => 1, + 'Node' => 'servername02.com', + 'Description' => 'Table Space threshold less than +90%', + 'UniqueID' => '4283289', + 'Severity' => 'Medium', + 'Title' => 'servername02-> tablespace02 threshold +is less' + } + } } }, }

I am looking to delete one reference Server01 content in the above. Looking for some help on this

2018-03-27 Athanasius added code and paragraph tags


In reply to Delete reference tree from a file by aravind.kalla

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.