XML-фильтр Logstash - PullRequest
       8

XML-фильтр Logstash

0 голосов
/ 05 сентября 2018

Я хочу сохранить следующие данные в формате xml одновременно.

<title>name</title>
<destination>my name</destination>
<log>hi~ my name is taewoo!</log>
<date>2018-09-04T09:00:00</date>

Однако каждое поле сохраняется отдельно, создавая три документа.

Ниже приведен файл конфигурации.

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 {}
}
...