Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unix:XML标记之间的通配符子字符串搜索_Xml_Linux_Shell_Unix - Fatal编程技术网

Unix:XML标记之间的通配符子字符串搜索

Unix:XML标记之间的通配符子字符串搜索,xml,linux,shell,unix,Xml,Linux,Shell,Unix,我有一个巨大的web服务请求和响应的XML日志文件。 每个Web服务都有一个请求标记,如下所示 <s:Envelope ......Some tags before Request tag <xyzServiceRequest>Request Data </xyzServiceRequest></s:Body></s:Envelope> <s:Envelope ....Some more tags before Request

我有一个巨大的web服务请求和响应的XML日志文件。 每个Web服务都有一个请求标记,如下所示

<s:Envelope ......Some tags before Request tag <xyzServiceRequest>Request Data   </xyzServiceRequest></s:Body></s:Envelope>


<s:Envelope ....Some more tags before Request tag <abcServiceRequest xmlns="urn" >Request Data  of another service </abcServiceRequest></s:Body></s:Envelope>

<s:Envelope ...Few more tags before request <defServiceRequest xmlns="urn" /> </s:Body></s:Envelope>
使用


grep-o'使用它来避免重复结果
grep-o'@arun kumar:interest。我本来会做一个‘排序| uniq’,但那会增加N log N成本。“| sort | uniq”的好处在于,添加uniq-c并获得出现次数很容易。我相信你也可以用awk来做这件事。
grep -o '<[^</]*ServiceRequest'    YourLogFile  | sed 's/<//'