I have a big size file like 5GB with .gz
. Inside that file, we have few XML files that contains values that I want to search and extract just in case if those values are there.
For example I want to extract the tags that contains the name NOOSS
and also the subcontent of this tags like <pmJobId>
, <requestedJobState>
, <reportingPeriod>
, <jobPriority>
from the the .gz
file
<Pm xmlns="urnCmwPm">
<pmId>1</pmId>
<PmJob>
<pmJobId>NOOSSCONTROLExample</pmJobId>
<requestedJobState>ACTIVE</requestedJobState>
<reportingPeriod>FIVE_MIN</reportingPeriod>
<jobType>MEASUREMENTJOB</jobType>
<jobPriority>HIGH</jobPriority>
<granularityPeriod>FIVE_MIN</granularityPeriod>
<jobGroup>Sla</jobGroup>
<reportContentGeneration>CHANGED_ONLY</reportContentGeneration>
<MeasurementReader>
<measurementReaderId>mr_2</measurementReaderId>
<measurementSpecification struct="MeasurementSpecification">
<measurementTypeRef>Anything</measurementTypeRef>
</measurementSpecification>
<thresholdRateOfVariation>PER_SECOND</thresholdRateOfVariation>
</MeasurementReader>
<MeasurementReader>
<measurementReaderId>mr_1</measurementReaderId>
<measurementSpecification struct="MeasurementSpecification">
<measurementTypeRef>ManagedElement=1,SystemFunctions=1,Pm=1,PmGroup=OSProcessingLogicalUnit,MeasurementType=CPULoad.Total</measurementTypeRef>
</measurementSpecification>
<thresholdRateOfVariation>PER_SECOND</thresholdRateOfVariation>
</MeasurementReader>
</PmJob>
</Pm>
I was using cat *gz 1 zgrep -a "PmJobId"
but the output only show the <pmJobId>
value and not the rest of the information or tags.
Please your help, I'm noobie on this.
Im using CentOS - RedHat Linux.
Thanks
PmJob
node and all its sub-nodes if the correspondingpmJobId
node's value contains the substringNOOSS
? And you want the actual XML? It would benefit if you could show the result, given the example document you include in the question.xmlns="urnCmwPm"
contains an invalid URI.