如何在elasticsearch中上载xml文件?

thigvfpy  于 2021-07-13  发布在  ElasticSearch
关注(0)|答案(2)|浏览(417)

有人能帮我一个视频教程或简单的步骤,如何上传ElasticSearchxml文件?提前谢谢!

o2rvlv0m

o2rvlv0m1#

您需要从logstash示例读取xml文件,以使用以下logstash配置将其存储到elasticsearch示例。

input {
    file {
        path => "/path/to/your/xml/*.xml"
        start_position => beginning
        sincedb_path => "/dev/null"     
    } 
} 
filter {
    xml {
          source => "message"
          target => "doc"
          store_xml => false
          xpath => [
            "/msg/@time", "time",
            "/msg/@time_norm", "time_norm"
          ]
        }
    }
output {   
    elasticsearch { hosts => ["localhost:9200"] }   
    stdout { codec => rubydebug } 
}
14ifxucb

14ifxucb2#

fscrawler还支持读取xml文件。看到了吗https://fscrawler.readthedocs.io/en/latest/admin/fs/local-fs.html#indexing-xml文档
免责声明:我是fscrawler的作者

相关问题