Xml attribute parsing through Logstash + file beat

This is my xml

<OTA_HotelAvailRS>M1S</OTA_HotelAvailRS>

from above one i need M2S attribute value as new column in Kibana

Can you share sample conf which will help for my above xml please

My xml is from text file

input {
beats {
port => 5044
}
}
filter {
csv {
separator => "@$@"
columns => ["date","est_cd","hotelhubcode","sessionid","searchid","requestid","request","response","parentmethodname","starttime","endtime","duration","exception","notes","channelpropertyid"]
}
xml {
store_xml => "false"
source => "response"
remove_namespaces => "true"
xpath =>[
"/OTA_HotelAvailRS/RoomType/@RoomType/text()","RoomType"
]
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "4jun9"
#user => "elastic"
#password => "changeme"
}
}

Working great for me with following log stash changes

input {
beats {
port => 5044
}
}
filter {
xml {
store_xml => "false"
source => "message"
remove_namespaces => "true"

xpath =>[
"/propertyAvailability/hotelRates/hotel/bookingChannel/ratePlan/roomDetails/hhBedTypes/hhBedType/@hhBedType","hhBedType"
]
}
}

output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "10jun2"
}
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.