【问题标题】:Export data from Elasticsearch to CSV using Logstash使用 Logstash 将数据从 Elasticsearch 导出到 CSV
【发布时间】:2016-05-03 14:39:55
【问题描述】:

如何使用 Logstash 将数据从 Elasticsearch 导出到 CSV?我只需要包含特定的列。

【问题讨论】:

    标签: elasticsearch logstash export-to-csv


    【解决方案1】:

    安装 2 个pluginselasticsearch input plugincsv output plugin。 然后创建a configuration file。这里是a good example for this particular case

    您现在可以开始了,只需运行:
    bin/logstash -f /path/to/logstash-es-to-csv-example.conf

    并检查output -> csv -> path中指定的export.csv文件。

    【讨论】:

      【解决方案2】:

      重要提示: 使用 Logstash 5.x 时,csv 输出插件中存在一个已知错误。该插件生成一个%{host} %{message}%{host} %{message}%{host} %{message} 的字符串。 有一个未解决的问题:https://github.com/logstash-plugins/logstash-output-csv/issues/10

      作为一种解决方法,您可以:

      • 降级到 Logstash 2.x 直到问题得到解决
      • 改用文件输出

        file {
            codec => line { format => "%{field1},%{field2}"}
            path => "/path/to/data_export.csv"
        }
        
      • 根据github讨论修改插件代码...

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-01-10
        • 1970-01-01
        • 1970-01-01
        • 2020-07-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多