ELK记录着kibana

时间:2016-06-18 01:25:50

标签: logging elasticsearch logstash kibana

我是大数据的新手,我在将json文件导入kibana时遇到了一些困难,我不知道如何映射json文件,所以如果你能帮助我,我会非常感激,这里是json文件

    {"index":{"_id":"1"}}
{"Positivity_score":55.17999999,"Negativity_score":35.12,"Average_Positivity":0.8621874999999999,"Average_Negativity":0.54875}
{"index":{"_id":"2"}}
{"Positivity_score":134.71999999999997,"Negativity_score":90.08000000000017,"Average_Positivity":0.8419999999999999,
"Average_Negativity":0.5701265822784821}
{"index":{"_id":"3"}}
{"Positivity_score":44.800000000000004,"Negativity_score":28.799999999999986,"Average_Positivity":0.7344262295081968,
"Average_Negativity":0.47999999999999976}

这是我写的日志可能是错误的

curl -XPUT http://localhost:9200/sentimentresult -d '
{
 "mappings" : {
  "_default_" : {
   "properties" : {
    "_id" : {"type": "integer","index":"not_analyzed"},
    "Positivity_score" : { "type" : "double" },
    "Negativity_score" : { "type" : "double" },
    "Average_Positivity" : { "type" : "double"},
    "Average_Positivity" : { "type" : "double"}
   }
  }
 }
}
';

1 个答案:

答案 0 :(得分:0)

使用上面的默认映射创建索引后,您只需将JSON文件发布到_bulk endpoint,就像这样:

BufferedReader