Hi All,
I am stuck with this for 3 -4 weeks . I have a configuration file as below and trying to pick up a xml file using logstash. I have used all the resources available under the sun to resolve it but to no avail. It just won't work. Can anyone please help me out?Would be much appreciated. Here is the code.
File to be picked up :
<stations lastupdate = "1512117393150" version = "2.0">
<station>
<id>2</id>
<name> xyz station</name>
<termnalName>31001</terminalName>
<lastcommitWithServer>1512117359697</lastCommitwithServer>
<lat>38.85725</lat>
<long>77.0533200</long>
<installed>true</installed>
<locked>false</locked>
<installDate>0</installDate>
<temporary>false</temporary>
<public>true</public>
<nbBikes>6</nbBikes>
<latestUpdateTime>151210259134</latestUpdateTime>
</station>
</stations>
Config file :
input {
file {
path => "C:\Users\sdutta\Desktop\kiblogs\*"
start_position => "beginning"
sincedb_path => "NUL"
type => "xml"
codec => multiline {
pattern => "<stations>"
negate => "true"
what => "previous"
}
}
}
filter {
xml {
source => "message"
store_xml => false
target => "stations"
xpath => [
"/stations/station/id/text()", "station_id",
"/stations/station/name/text()", "station_name"
]
}
}
output {
stdout {
codec => rubydebug
}
}