How to filter out an xml response with a specific root element

(davinder singh) #1

In my logs many xml response are printing, I want to filter-out/extract specific xml responses in logstash.
In below example there are two xml response, HtlResponse and SOAResult, I want to extract out say HtlResponse, and also want to know how many hotel were returned i.e. number of Htlid nodes present in xml response.
Please help. My motive is to generate Zabbix alerts if number of hotels returned are less than a threshold. We are using logstash, elasic search, TSD and zabbix.

apache log dummy text
search response :
<Htlid> 123 </Htlid>
<Htlid> 321 </Htlid>
Soa response :
<avail>hotel available </avail>

(system) #2