logstash config의 input/ output 부분 수정하면 file을 수집하여 elasticsearch로 보낼 수 있다.
ex)
input {
file {
path=>"D:/TestFilePath/textlog.txt"
start_position => "beginning"
type => textfile
}
}
filter {
#...
}
output {
if [type] == "textfile" {
elasticsearch {
hosts => ["http://localhost:9200","http://localhost:9200"]
manage_template => false
index => "textfile-index"
}
}
}
[작성시 주의]
1. input {
path => 부분에 \랑 / 주의
type => " " 쓰지 않음
}
2. output
{
if [type]에 " " 써야 함
}
반응형
'프로그래밍 > ELK' 카테고리의 다른 글
[elasticsearch error] overhead,spent (0) | 2021.06.15 |
---|---|
[ElasticSearch] 로그 수집 안되는 문제 (0) | 2021.06.11 |
[오류] elasticsearch - index가 갑자기 사라지는 문제 발생 !! (0) | 2020.10.12 |
[ElasticSearch] ElasticSearch 서비스로 설치 (0) | 2020.07.30 |
[nssm] nssm 다운로드/사용 (0) | 2020.07.30 |
댓글