Hello Experts ,
Need your assistance to extract output from one of the below XML tags.
I have three XML tags with same naming convention and I want only extract specific value 3 from the below tags.
can you help me to provide rex commend (or) any other commend which will only extract value 3 from the below tags.
<Val Ty="CHAR">Feedback</Val>
<Val Ty="CHAR">3</Val>
<Val Ty="CHAR">TRST</Val>
your help is much appreciated.
Hi
Try this
|makeresults |eval tag="<Val Ty=\"CHAR\">Feedback</Val>
<Val Ty=\"CHAR\">3</Val>
<Val Ty=\"CHAR\">TRST</Val>" |rex field=tag "CHAR\"\>(?P<output>(\d+))\<"
OR
| makeresults
| eval tag="<Val Ty=\"CHAR\">Feedback</Val>
<Val Ty=\"CHAR\">3</Val>
<Val Ty=\"CHAR\">TRST</Val>"
| rex field=tag max_match=0 "\"CHAR\">(?P<output>.+)<"
| eval result = mvindex(output,1)
Thanks @vnravikumar , below solution works.
Second solution didnt give me desired results.
|makeresults |eval tag="Feedback
3
TRST" |rex field=tag "CHAR\">(?P(\d+))<"
Hi
Try this
|makeresults |eval tag="<Val Ty=\"CHAR\">Feedback</Val>
<Val Ty=\"CHAR\">3</Val>
<Val Ty=\"CHAR\">TRST</Val>" |rex field=tag "CHAR\"\>(?P<output>(\d+))\<"
OR
| makeresults
| eval tag="<Val Ty=\"CHAR\">Feedback</Val>
<Val Ty=\"CHAR\">3</Val>
<Val Ty=\"CHAR\">TRST</Val>"
| rex field=tag max_match=0 "\"CHAR\">(?P<output>.+)<"
| eval result = mvindex(output,1)