0
로그 파일 mylogs.log
에서 JSON 데이터를 가져 오려고합니다. 다음은 내 logstash 설정 파일입니다. 내가 인스턴스를 Elasticsearch에 전송 & 구문 분석이 점점 어떤 JSON 데이터를 전달하는 경우,이 설정 파일을 실행 한 후Logstash에서 파일에서 json 데이터를 가져올 수 없습니다.
input {
stdin { }
file {
codec => "json"
path => "/logs/mylogs.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter{
json{
source => "message"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "jsonlog"
}
stdout { codec => rubydebug }
file {
path => "/logs/out.log"
}
}
. 나는 Elasticsearch 인스턴스에서 볼 수 있습니다. 그러나 로그 파일에있는 모든 데이터는 logstash에 의해 가져 오기되지 않습니다.
또한 Logstash &에 의해 구문 분석되는 JSON 데이터를 수동으로 추가 할 때 Elasticsearch 인스턴스를 전송할 때 해당 데이터도 내 OUTPUT 파일에 기록되지 않습니다.
문제가 무엇인지 알 수 없습니다.
내 샘플 JSON 데이터.
{ "logger":"com.myApp.ClassName", "timestamp":"1456976539634", "level":"ERROR", "thread":"pool-3-thread-19", "message":"Danger. There was an error", "throwable":"java.Exception" }
{ "logger":"com.myApp.ClassName", "timestamp":"1456976539649", "level":"ERROR", "thread":"pool-3-thread-16", "message":"I cannot go on", "throwable":"java.Exception" }
확인
"tags" => [ [0] "_jsonparsefailure" ]
응답의 오류를 받고 있어요. 알았다!!! '''json'' 필터를 설정 파일'''_jsonparsefailure'''에서 지우면 해결되었습니다. :) – mi6crazyheart