Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Need get data from XML file through shell script..


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Quote:
Originally Posted by RudiC
With your amended spec, try also
Code:
grep -E "<(timestamp|severity|message)" file | paste -sd"\t\t\n" | grep -E "ERROR.*thumbnail" | tr '\t' '\n'

thanks for your help, its not working and not giving any output.
# 9  
It has been tested with your input sample:
Code:
grep -E "<(timestamp|severity|message)" file | paste -sd"\t\t\n" | grep -E "ERROR.*thumbnail" | tr '\t' '\n'
 <timestamp>2019-03-13T04:52:49.648-05:00</timestamp>
 <severity>ERROR</severity>
<message>cannot make thumbnail image</message>

What are your OS and grep versions?
This User Gave Thanks to RudiC For This Post:
# 10  
Quote:
Originally Posted by RudiC
It has been tested with your input sample:
Code:
grep -E "<(timestamp|severity|message)" file | paste -sd"\t\t\n" | grep -E "ERROR.*thumbnail" | tr '\t' '\n'
 <timestamp>2019-03-13T04:52:49.648-05:00</timestamp>
 <severity>ERROR</severity>
<message>cannot make thumbnail image</message>

What are your OS and grep versions?
hi RudiC, my OS is RHEL 7.5, can you please share complete code , i think some where i am missing
# 11  
That IS the complete code, running with your input sample. Did you replace "file" with your input file name?
This User Gave Thanks to RudiC For This Post:
# 12  
Quote:
Originally Posted by RudiC
That IS the complete code, running with your input sample. Did you replace "file" with your input file name?
hi RudiC, thanks for your support, issue resolved, need small info what -sd will do in your code..?
# 13  
man paste:
Quote:
-d, --delimiters=LIST
reuse characters from LIST instead of TABs

-s, --serial
paste one file at a time instead of in parallel

HOW did you resolve the issue?
This User Gave Thanks to RudiC For This Post:
# 14  
gnu version
Code:
grep -B1 -A7 "ERROR" file | grep "<timestamp\|<severity\|<message"

Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How to Parse the XML data along with the URL in Shell Script?
Megala
Hi, Can anybody help to solve this. I want to parse some xmldata along with the URL in the Shell. I'm calling the URL via the curl command Given below is my shell script file export...... Shell Programming and Scripting
7
Shell Programming and Scripting
Convert XML to Data File in Shell Script
ragha81
Hi All, I will be getting a huge XML file with a lot of records in it. I need to convert it into multiple data files. SAMPLE XML FILE <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <ProductSalesHierachy> - <Portfolios> - <Portfolio productCode="P1"> ...... Shell Programming and Scripting
8
Shell Programming and Scripting
How to remove xml namespace from xml file using shell script?
Gary1978
I have an xml file: <AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Table1> <Data1 10 </Data1> <Data2 20 </Data2> <Data3 40 </Data3> <Table1> </AutoData> and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only. I tried using sed...... Shell Programming and Scripting
10
Shell Programming and Scripting
Help with shell script to extract data from XML file
yajaykumar
Hello Scripting Gurus, I need help with extracting data from the XML file using shell script. The data is in a large XML and I need to extract the id values of all completedworkflows. Here is a sample of it. Input and output data is also in the attached text files. <wfregistry>...... Shell Programming and Scripting
5
Shell Programming and Scripting
extract data from xml- shell script using awk
nishana
Hi, This is the xml file that i have. - <front-servlet platform="WAS4.0" request-retriever="SiteMinder-aware" configuration-rescan-interval="60000"> <concurrency-throttle maximum-concurrency="50" redirect-page="/jsp/defaulterror.jsp" /> - <loggers> <instrumentation...... Shell Programming and Scripting
5
Shell Programming and Scripting

Featured Tech Videos