【问题标题】:How to process a text file separated by spaces using logstash?如何使用logstash处理以空格分隔的文本文件?
【发布时间】:2018-09-01 18:31:16
【问题描述】:

我的日志文件

制造商型号里程制造_年发动机_排量发动机_动力车身_类型颜色_slug stk_年变速器门_计数 座位数燃料类型日期创建日期上次看到价格欧元 福特银河 151000 2011 2000 103 无人 5 7 柴油 2015-11-14 18:10:06.838319+00 2016-01-27 20:40:15.46361+00 10584.75 斯柯达 octavia 143476 2012 2000 81 无人 5 5 柴油 2015-11-14 18:10:06.853411+00 2016-01-27 20:40:15.46361+00 8882.31 宝马 97676 2010 1995 85 无人 5 5 柴油 2015-11-14 18:10:06.861792+00 2016-01-27 20:40:15.46361+00 12065.06 斯柯达 fabia 111970 2004 1200 47 无人 5 5 汽油 2015-11-14 18:10:06.872313+00 2016-01-27 20:40:15.46361+00 2960.77 斯柯达 fabia 128886 2004 1200 47 无人 5 5 汽油 2015-11-14 18:10:06.880335+00 2016-01-27 20:40:15.46361+00 2738.71

错误如下

[2018-03-23T11:35:20,226][ERROR][logstash.agent]未能执行操作 {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash: :PluginLoadingError", :message=>"找不到任何名为 'txt' 的过滤插件。你确定这是正确的吗?

我的 conf 文件在下面

输入{文件{path =>“/home/elk/data/logklda.txt”start_position =>“开始” sincedb_path => "/dev/null"}}
filter{txt {separator => " "columns => ["name","type","category","date","error_log"]}} 输出 {elasticsearch {hosts => "localhost"index => "logklda"document_type => "category"}stdout{}}

【问题讨论】:

  • 你的logstash配置怎么样?

标签: elasticsearch logstash config


【解决方案1】:

过滤器 txt 不存在。从您的配置来看,您似乎想使用csv filter。在您的情况下,将 txt 替换为 csv,配置将如下所示:

csv {
  separator => " "
  columns => ["name","type","category","date","error_log"]
}

【讨论】:

    【解决方案2】:

    有名为“txt”的过滤器不存在。我认为您必须检查此 logstash 指南站点并更正您的代码。 https://www.elastic.co/guide/en/logstash/current/filter-plugins.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-07
      • 1970-01-01
      • 1970-01-01
      • 2010-09-14
      相关资源
      最近更新 更多