原始数据
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<httpSample s="true">
<responseData class="java.lang.String">0</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">2000</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">2002</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">4000</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">4002</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">4004</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">3</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">1</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">5</responseData>
</httpSample>
<httpSample s="true">
<responseData class="java.lang.String">7</responseData>
</httpSample>
下面是解析的命令
egrep ">[0-9]{1}" 1.log |cut -c 42- | cut -d '<' -f 1 > result
使用sort 配合 uniq去检测结果是否有重复的数值
sort -n result |uniq -D