I want to store the following xml format data at once.
<title>name</title> <destination>my name</destination> <log>hi~ my name is taewoo!</log> <date>2018-09-04T09:00:00</date>
However, each field is stored separately, creating three documents.
Below is the configuration file.
How can I fix all the fields in one document?
input {
file {
path => "/usr/local/ELK/logstash-6.3.2/config/test1.xml"
start_position => "beginning"
type => "xml"
}
}
filter {
xml {
remove_namespaces => true
source => "message"
xpath => ["/title", "title",
"/destination", "destination",
"/log", "log",
"/date", "date"]
target => "doc"
store_xml => true
}
}
output {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "t4"
# document_type => "test"
user => "elastic"
password => "root123"
}
stdout {}
}