2023년 4월 30일 일요일

JSON 구문 해석기 jq

컴퓨터 읽기 좋으라고 만든 JSON 포맷.
[root@Centos7 ~]# cat eve.json
{"timestamp":"2023-04-30T13:06:46.255425+0900","flow_id":868785597342197,"in_iface":"eth0","event_type":"alert","src_ip":"192.168.31.177","src_port":0,"dest_ip":"192.168.31.247","dest_port":0,"proto":"ICMP","icmp_type":8,"icmp_code":0,"alert":{"action":"allowed","gid":1,"signature_id":1000000,"rev":0,"signature":"ping-request","category":"","severity":3},"flow":{"pkts_toserver":108,"pkts_toclient":107,"bytes_toserver":7992,"bytes_toclient":7918,"start":"2023-04-30T13:04:58.025077+0900"},"payload_printable":"abcdefghijklmnopqrstuvwabcdefghi","stream":0}
{"timestamp":"2023-04-30T13:06:46.255457+0900","flow_id":868785597342197,"in_iface":"eth0","event_type":"alert","src_ip":"192.168.31.247","src_port":0,"dest_ip":"192.168.31.177","dest_port":0,"proto":"ICMP","icmp_type":0,"icmp_code":0,"alert":{"action":"allowed","gid":1,"signature_id":1000001,"rev":0,"signature":"ping-response","category":"","severity":3},"flow":{"pkts_toserver":108,"pkts_toclient":108,"bytes_toserver":7992,"bytes_toclient":7992,"start":"2023-04-30T13:04:58.025077+0900"},"payload_printable":"abcdefghijklmnopqrstuvwabcdefghi","stream":0}

이때 jq라는 툴을 사용하면 사람도 편하게 읽을 수 있다.

2023년 4월 25일 화요일

Splunk DB Connect

스플렁크와 DB 연동을 도와주는 앱.


2023년 4월 23일 일요일

정규표현식 몰라도 된다?

ChatGPT야 사용자 ID 문자열 검사하는 정규표현식 만들어줘.

make regex to match user id forms from 'Thu Feb 03 2022 00:15:01 www1 sshd[4633]: Failed password for jira from 194.215.205.19 port 2329 ssh2'


2023년 4월 20일 목요일

Filebeat 경로

zip 파일 설치 시 기본 경로는 압축을 해제한 경로.
zip, tar.gz, or tgz

2023년 4월 16일 일요일

installing Python for Scientific

스플렁크 MLTK(Machine Learning Tool Kit) 앱을 사용하려면 사전에 Python for Scientific 앱을 설치해야 한다.


2023년 4월 9일 일요일

Filebeat의 processors - 2nd

로그스태시에서 원본 데이터 발생 시간을 기록하려면
filter {
 mutate {
  remove_field => ["host", "path", "@version"]
 }

 dissect {
  mapping => { "message" => '%{} [%{timestamp}] %{}' }
 }
}

크리에이티브 커먼즈 라이선스