본문 바로가기

Monitoring Tools/ELK Stack

(20)
[Elasticsearch] Validation Failed: 1: this action would add [2] shards, but this cluster currently has [999]/[1000] maximum normal shards open default shard 개수가 max 수치에 도달하여 수집이 안되는 현상 shard 개수 확인 - "max_shards_per_node": "1000"curl -u ****:**** -XGET 127.0.0.1:9200/_cluster/settings?include_defaults | jq . | grep shard "same_shard": { "total_shards_per_node": "-1", "shard_state": { "shard": "0.45" "max_shards_per_node.frozen": "3000", "max_shards_per_node": "1000", "pre_filter_sha..
rsyslog + elasticsearch, logstash, filebeat 등 로그 indexing의 3가지 방법 개요 Rsyslog로 수집되는 Log를 elasticsearch로 indexing 하는 방법 방법은 여러가지가 있겠지만 간단히 아래 3개지 방법으로 indexing이 가능할 것 같다. rsyslog로 수집하는 로그를 json으로 변환하고 rsyslog omelasticsearch 모듈을 이용하여 elasticsearch 에 indexing. rsyslog omfwd 모듈을 이용하여 logstash로 포워드 omfile 모듈을 이용하여 file log를 쌓고 filebeat로 수집 여기서는 DELL EMC SAN Storage 의 로그를 수집하는 것이 목적으로 아래 내용과 크게 상관이 없을 수 있다. 설정 DELL EMC SAN Storage Log 설정 facility, priority 등의 설정은 없고..
11.1 metricbeat system modules 사용하기 * metricsets 1. cpu - cpu 통계정보 : idle, irq, user, system, iowait, softirq, cores, nice, stew, total 2. load - cpu load average(1,5,15분 평균) 값으로 linux 계열에 적용되며 windows는 사용 불가 3. memory - memory 통계 정보 : swap, total, used, free, actual 4. network - interface 별 네트워크 통계 정보 : bytes, fropped, errors, packets 5. process - process 별 통계 정보 : state, memory, cpu, cmdline 6. process_summary - process state 요약..
11. metricbeat 설치(windows agent) 1. metricbeat를 이용하여 프로세스나 OS 레벨에서 수집가능한 지표(cpu, memory, io 등등)를 수집 2. 다운로드 - 운용 중인 elastcisearch 버전 7.15 버전과 동일한 zip버전으로 다운로드 - https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.15.2-windows-x86_64.zip - 전체 버전 참조 : https://www.elastic.co/kr/downloads/past-releases#metricbeat Past Releases of Elastic Stack Software Looking for a past release of Elasticsearch, Logstash, Kibana, ..
10. xpack security 적용 1. elasticsearch 에 xpack.security 설정 > vim /etc/elasticsearch/elasticsearch.yml xpack.security: enabled: true transport: ssl: enabled: true 2. elasticsearch에 접근할 계정 생성 elastic: superuser kibana_system: kibana가 elasticsearch로 접근 할 계정 > /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system..
9. Elasticsearch 모니터링 API 정보 http://es-host:9200/_cat/allocation?v -> 클러스터 디스크 현황 http://es-host:9200/_cluster/health?pretty -> 클러스터 헬스체크 http://es-host:9200/_cat/indices?v -> 인덱스 상태 확인 http://es-host:9200/_cat/shards -> 모든 샤드 상태 확인 http://es-host:9200/_cat/shards/{index_name}?v -> 특정 인덱스의 샤드 상태확인 키바나 index pattern id 정보 조회 http://kibana:5601/api/saved_objects/_find?type=index-pattern index doc 조회 http://es-host:9200/{index..
8. Windows Sysmon + Winlogbeat + logstash 1. sysmon Download : https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon Sysmon - Windows Sysinternals Monitors and reports key system activity via the Windows event log. docs.microsoft.com 2. sysmon config file : https://github.com/SwiftOnSecurity/sysmon-config GitHub - SwiftOnSecurity/sysmon-config: Sysmon configuration file template with default high-quality event tracing Sysmon co..
7. Elastalert 1. 설치하기 전에 - ELK에서 제공하는 x_pack을 이용한 경보 알람 기능은 유료이며 UI로 구현은 되지 않지만 무료로 여러 필터기능을 사용할 수 있는 elastalert를 이용 2. 설치 # 필수 패키지 설치 [root@localhost]# yum install python3 python3-pip gcc gcc-c++ gcc-cpp python3-devel # pip upgrade [root@localhost]# pip3 install --upgrade pip # 설치 진행 [root@localhost]# pip3 install "setuptools>=11.3" python setup.py install [root@localhost]# pip3 install elastalert or git clo..
6.2 filebeat offset 초기화 1. log 수집 도중 알수 없는 이유로 수집이 중단 되거나 특정 log 파일을 다시 읽어 드리고 싶을때 2. 전체 초기화 - filebeat data home 확인 [root@MON2 filebeat]# ps aux | grep filebeat-logstash root 32061 87.5 0.7 2204676 377292 ? Ssl 12:01 13:16 /usr/share/filebeat/bin/filebeat --environment systemd -c /etc/filebeat-logstash/filebeat.yml --path.home /usr/share/filebeat --path.config /etc/filebeat-logstash --path.data /var/libfilebeat-logsta..
6.1 filebeat multiple indexing 1. 다른 종류의 로그를 각각 다른 index로 파싱 하고자 하는 경우 logstash를 이용해도 되지만 elasticsearch로 바로 쏘는 경우나 수집단계에서 index를 구분 하고 자 하는 경우 filebeat의 설정을 이용하면 됨. 2. filebeat.yml - fields - log_topics를 이용하여 구분 # ============================== Filebeat inputs =============================== filebeat.inputs: # Each - is an input. Most options can be set at the input level, so # you can use different inputs for various configu..