【问题标题】:Logstash filter to identify address matchesLogstash 过滤器来识别地址匹配
【发布时间】:2019-02-12 20:21:21
【问题描述】:

我有一个包含客户地址的 CSV 文件。我还有一个带有我自己地址的 Elasticsearch 索引。我使用 Logstash 作为导入 CSV 文件的工具。如果客户地址已经存在,我想使用 logstash 过滤器来检查我的索引。我发现的只是默认的弹性搜索过滤器(“将 Elasticsearch 中以前日志事件中的字段复制到当前事件”),它看起来不适合解决我的问题。我的问题是否存在其他过滤器?

到目前为止,这是我的配置文件:

input {
  file {
    path => "C:/import/Logstash/customer.CSV"
    start_position => "beginning"
    sincedb_path => "NUL"
  }
}
filter {
  csv {
    columns => [
      "Customer",
      "City",
      "Address",
      "State",
      "Postal Code"
      ]
      separator => ";"
  }
}
output {
    elasticsearch {
      hosts => [ "localhost:9200" ]
      index => "customer-unmatched"
    }
    stdout{}
}

【问题讨论】:

  • 如何定义“客户地址已经存在”?它有唯一的ID吗?还是基于“城市”、“地址”、“州”、“邮政编码”所有值的精确匹配?
  • 也许我不清楚:我的 ES 索引基于我们收集的公司地址,现在我想检查从我的客户那里导入的地址是否已经存在于我的索引中,例如模糊匹配, 我们的索引有一个 ID,是的,但没有我客户的地址。

标签: elasticsearch filter logstash-configuration


【解决方案1】:

在处理 Logstash 事件时,您通常无法访问 Elasticsearch 中的数据。考虑在Ingest node 上使用pipeline

【讨论】:

    猜你喜欢
    • 2016-11-29
    • 1970-01-01
    • 2015-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多