Logstash Array split为一个元素数组提供Nilclass

时间:2018-03-30 15:08:32

标签: elasticsearch split logstash

我正在尝试通过filebeat->输入日志中的json数据; logstash到elasticsearch,但无论我尝试什么,我似乎都会得到NilClass错误。

数据样本:

{"student":[{"details":{"name":chirs,"lname":dave},"age":10,"grade":1.2,"id":"323"}],"id":"metric95"}

我的logstash配置是:

input {
    beats {
        port => "5044"
    }
}
filter {
json {
    source => "message"
  }
 split {
      field => "[student]"
    }
}
output {
elasticsearch {
        hosts => [ "localhost:9200" ]
    }

    stdout { codec => rubydebug }
} 

Error:  split - Only String and Array types are splittable. field:[student] is of type = NilClass

1 个答案:

答案 0 :(得分:0)

请尝试

split {
  field => "student"
}

并用双引号{"name":"chirs","lname":"dave"}