【问题标题】:How to load json file in elastic search如何在弹性搜索中加载 json 文件
【发布时间】:2021-09-10 19:32:48
【问题描述】:

我们有主服务器、数据服务器、客户端、logstash 和 kibana 服务器以及我需要如何以及从何处加载此 json 文件?

使用文件 homeloan_index.json 在 QA 环境中创建一个新的 HOME LOAN 索引

谢谢, 巴拉

【问题讨论】:

  • 这个 json 文件包含要插入到 elasticsearch 索引中的数据(日志)?
  • 正确。 json文件包含数据。

标签: json elasticsearch


【解决方案1】:

您可以使用 logstash 来做到这一点:

input {
  file {
    path => "/path/to/your/file.csv"
    start_position => "beginning" 
  }
}
filter {
  csv {
     separator => ","
    columns => ["id","name","age","money"] <--- insert here your columns
  }
}
output {
   elasticsearch {
     ...
  }

查看文档:https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-15
    • 2017-07-07
    • 2015-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多