LogStash特定字段作为索引

时间:2018-06-22 13:43:50

标签: elasticsearch logstash elastic-stack

我正在尝试使用Logstash在mongo和Elasticsearch之间同步数据。

我将json文件用作输入和单个输出到不同的Elasticsearch索引。我仍将弹性搜索生成的索引视为随机UUID。相反,我希望对状态字段进行索引。

这是我的配置:

input{
  file{
    path => ["/Users/vicky/Downloads/ESpoc/data/staging.json"]
    type => "json"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}
output { 
    elasticsearch { 
    hosts => ["localhost:9200"]
    index => "staging"
    document_id => "%{[status]}"
  }
}

0 个答案:

没有答案
相关问题