티스토리 뷰
반응형
fendys.myqnapcloud.com kafka -> local server file
input {
kafka {
bootstrap_servers => "fendys.myqnapcloud.com:9094"
topics_pattern => ".*"
codec => json
group_id => "all-log-idc-backup"
consumer_threads => "10"
}
}
filter {
if [service][name] {
if [service][type] {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[service][name]}/%{+YYYY}-%{+MM}-%{+dd}-%{[service][name]}-%{[service][type]}.log" } }
} else {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[service][name]}/%{+YYYY}-%{+MM}-%{+dd}-none_type.log" } }
}
}
else if [cloud][service][name] {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[cloud][service][name]}/%{+YYYY}-%{+MM}-%{+dd}-%{[cloud][service][name]}.log" } }
}
else {
if [service][type] {
mutate { replace => { "[@metadata][archive][namespace]" => "none_name/%{+YYYY}-%{+MM}-%{+dd}-%{[service][type]}.log" } }
} else {
mutate { replace => { "[@metadata][archive][namespace]" => "none_name/%{+YYYY}-%{+MM}-%{+dd}-none_type.log" } }
}
}
if ![@metadata][archive][namespace] {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[@metadata][kafka][topic]}/%{+YYYY}-%{+MM}-%{+dd}-%{[@metadata][kafka][topic]}.log" } }
}
}
output {
file {
path => "/data/%{+YYYY}/%{+MM}/%{+dd}/%{[@metadata][archive][namespace]}"
codec => "json_lines"
}
}
fendys.myqnapcloud.com kafka -> aws s3 bucket
input {
kafka {
bootstrap_servers => "fendys.myqnapcloud.com:9094"
topics_pattern => ".*"
group_id => "log-archiver"
codec => json
decorate_events => true
}
}
filter {
if [service][name] {
if [service][type] {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[service][name]}/%{+YYYY}/%{+MM}-%{+dd}/%{[service][type]}" } }
} else {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[service][name]}/%{+YYYY}/%{+MM}-%{+dd}/none_type" } }
}
}
else if [cloud][service][name] {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[cloud][service][name]}/%{+YYYY}/%{+MM}-%{+dd}" } }
}
else {
if [service][type] {
mutate { replace => { "[@metadata][archive][namespace]" => "none_name/%{+YYYY}/%{+MM}-%{+dd}/%{[service][type]}" } }
} else {
mutate { replace => { "[@metadata][archive][namespace]" => "none_name/%{+YYYY}/%{+MM}-%{+dd}/none_type" } }
}
}
if ![@metadata][archive][namespace] {
mutate { replace => { "[@metadata][archive][namespace]" => "%{[@metadata][kafka][topic]}/%{+YYYY}/%{+MM}-%{+dd}" } }
}
}
output {
s3{
access_key_id => "${S3_ACCESS_KEY_ID}"
secret_access_key => "${S3_SECRET_ACCESS_KEY}"
region => "ap-northeast-2"
bucket => "${S3_BUCKET}"
rotation_strategy => "size_and_time"
size_file => 100000000
time_file => 10
codec => "json_lines"
canned_acl => "bucket-owner-full-control"
encoding => "gzip"
prefix => "%{[@metadata][archive][namespace]}"
temporary_directory => "/logstash/data/s3-temp"
upload_workers_count => 16
validate_credentials_on_root_bucket => false
additional_settings => {
force_path_style => true
follow_redirects => false
}
}
}
logstash.yml
수정한 부분
#pipeline.workers: 1
pipeline.workers: 12
#
# How many workers should be used per output plugin instance
#
# pipeline.output.workers: 1
#
# How many events to retrieve from inputs before sending to filters+workers
#
# pipeline.batch.size: 125
pipeline.batch.size: 1024
반응형
'linux' 카테고리의 다른 글
linux bash user 90 day no login chshell nologin! (0) | 2023.11.01 |
---|---|
linux 90 days no login users change nologin mode! bash scripts (0) | 2023.10.21 |
How to fix "pvs shows unknown device" (1) | 2023.05.16 |
NUMA disable (0) | 2023.05.14 |
systemd 상태 확인에 따른 서비스 기동 스크립트 (0) | 2022.08.09 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- linux command log
- dl20 g9 centos7 설치
- vm rac
- 특정 라인삭제
- dl20
- centos7 ntp
- nxos ansible
- oracle linux8 kernel
- DL20 GEN9 장비에 CentOS 7
- ios ansible
- ansible ios
- 윈도우서버 계정 관려
- 윈도우 cmd 계정 관리
- ipmi
- windows.old 강제삭제
- cmd로 계정 생성
- nutanix rac
- kernel 변경
- 특정 문구 치환
- cgroup
- 리눅스 커맨드 로그남기기
- ILO
- CentOS 7 GUI
- shell connmad log
- ISCSI 볼륨 RAC
- cmd로 윈도우 계정 관리
- ansible network
- cisco ansible
- dl20 centos7
- chrony
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함