0
내 종료 시간이 다르기 때문에 시간 차이를 수동으로 계산해야 할 필요가 있습니다. 매우 큰 양의 로그가있는 경우에는 &에 24 시간이 걸릴 수 있습니다. 그것은 실제로 형식의 올바른 날짜 미세 & 수익을 작동elasticsearch-logstash 시차 계산 (ELK 5.3)
elasticsearch {
query => "Event:'Sent' AND ID:%{[ID]}"
index => "mylog*"
result_size => "1"
enable_sort => "false"
fields => { "@timestamp" => "SentTime" }
}
: 내가하여 이전 로그에서 시작 시간을 얻을 수 있었다 "2017-03-29T22 : 00 : 03.000Z"
그러나 "1 월 18 일 1970 08 : 07 : 09.056"형식으로 반환 값 : 그것은 나쁜거야
ruby {
code => "event.set('[SecondsToDeliver]', event.get('@timestamp').to_f - event.get('SentTime').to_f)"
add_tag => [ "rubyfilter" ]
}
나는 그것이 사소한 구문 오류입니다하지만 난 그것을 잡으려고 관리 할 수 없습니다 확신합니다.
elasticsearch {
hosts => ["Your elastic host"]
query => 'Event:"Sent" AND ID:"%{ID}"'
fields => { "@timestamp" => "SentTime" }
tag_on_failure => [ "NoSent_ID" ]
}
date {
match => ["[SentTime]", "ISO8601"]
target => "[SentTime]"
}
ruby {
init => "require 'time'"
code => "duration = (event.get('@timestamp') - event.get('SentTime')) rescue nil; event.set('Log_duration', duration); "
}
: