logstash.conf
input - filter - output
1. json
filter {
json {
source => "message"
}
}
☞ json parsing 을 하기 위한 field 를 지정하게 된다. 즉, message 필드를 json으로 파싱한다는 의미
아래 로그가 필드가 더 많은 걸 알 수 있다.
2. mutate
특정 필드 가공
- add_field
- remove_field -> @timestamp, _id, _type, _index 제거 안 됨
host.keyword와 host가 동시에 있는데, host.keyword 제거 안 됨. host 제거하면 하위 모든 것 삭제됨
keyword는 mapping에서 text type이기 때문에 자동 생성됨. 이미 생성된 index는 mapping을 수정할 수 없음
Todo.
에이전트에서 오는 로그와 웹 서버에서 오는 로그를 구분해 다른 index 주기
'개발' 카테고리의 다른 글
매우 간단한 python keylogger 만들기 (0) | 2021.08.26 |
---|---|
[멀티쓰레드] semaphore, mutex 개념 (0) | 2021.08.24 |
동기 비동기/ blocking nonblocking 개념 (0) | 2021.07.29 |
[python] socket과 multi-thread (0) | 2021.07.28 |
Redis 시작하기, 명령어, flask와 연동 (0) | 2021.07.16 |
댓글