elasticsearch logstashxml过滤器
我想一次存储以下xml格式的数据elasticsearch logstashxml过滤器,elasticsearch,logstash,elasticsearch,Logstash,我想一次存储以下xml格式的数据 <title>name</title> <destination>my name</destination> <log>hi~ my name is taewoo!</log> <date>2018-09-04T09:00:00</date> 你能展示一下你的文件是什么样子吗?使用插件应该最有可能解决问题。如果使用多行插件,则应该使用类似于此的配置:多行{patte
<title>name</title>
<destination>my name</destination>
<log>hi~ my name is taewoo!</log>
<date>2018-09-04T09:00:00</date>
你能展示一下你的文件是什么样子吗?使用插件应该最有可能解决问题。如果使用多行插件,则应该使用类似于此的配置:
多行{pattern=>“$”negate=>“true”what=>“previous”}
。
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 {}
}