레이블이 tech인 게시물을 표시합니다. 모든 게시물 표시
레이블이 tech인 게시물을 표시합니다. 모든 게시물 표시

2025년 9월 7일 일요일

Logstash 필터 date - 4th

DB 데이터 연동.
[2025-09-07T11:06:48,019][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2025-09-07T11:07:00,219][INFO ][logstash.inputs.jdbc     ][main][d56fa9ad43d4dc4ae19f64f322de33854c6e9d33b5fc7c06354603bf613db2ee] (0.001000s)
select a.cid, a.timestamp, b.sig_name, inet_ntoa(c.ip_src), inet_ntoa(c.ip_dst), unhex(d.data_payload)
from event a, signature b, iphdr c, data d
where a.signature = b.sig_id
and a.sid = c.sid and a.cid = c.cid
and a.sid = d.sid and a.cid = d.cid
and a.cid > 0

2025년 8월 30일 토요일

정규표현식 성능을 높이려면

정규표현식 메타문자의 성능 우선순위가 있느냐는 질문을 받았다. 일단 메타문자는 검사 범위의 차이를 가지고 있을 뿐, 성능 차이는 없다. 하지만 성능 우열을 결정할 수는 있다. 기준은 내가 찾으려는 문자열의 위치. 

수량자는 최대 검사모드가 디폴트이기 때문에 .*은 입력 순간 모든 문자를 검사한다. 이후 종료 문자인 b를 찾아야 하는데 b의 위치는 뒤에서 두 번째이므로 한 단계만 뒤로 후퇴하면 끝.


2025년 8월 24일 일요일

VIM vs AWK - 2nd

강의 이해를 위해 요구되는 사전 지식들.


필수 요건으로 못박고 싶지만 그랬다간 망할까봐 권장으로 타협. 출강 기관 측은 아예 빼자고 하는데 그러고 싶진 않다. 내 강의 정체성이기 때문.

2025년 8월 7일 목요일

엘라스틱 Runtime field - 13th

uri에서 변수를 추출하는 런타임 필드.


2025년 8월 6일 수요일

Elasticsearch 9.0의 변화 - 5th

단일 노드 조건에서 버전 업그레이드는 매우 간단하다. data와 config 디렉토리만 덮어쓰면 됨. 그런데 'v9.0.3 -> v9.1.0' 업그레이드 과정에서 다음 에러 발생. 'v9.0.1 -> v9.0.3' 과정까지는 문제 없었는데(..)
PS D:\ELK\elasticsearch-9.1.0\bin> .\elasticsearch
java.lang.RuntimeException: starting java failed with [1]
output:
[0.003s][error][logging] Error opening log file 'logs/gc.log': No such file or directory
[0.003s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed.
error:
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,level,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.

2025년 8월 3일 일요일

2025년 7월 23일 수요일

VIM vs AWK

VIM을 이용한 월단위 시간 정보 요약.

2025년 7월 19일 토요일

데이터 노가다 실수담 - 12th

리눅스 secure 로그는 연도 정보를 기록하지 않는다. 다음은 filebeat의 시간 정보 파싱 프로세서.
processors:
  - include_fields:
      fields: "message"
  - dissect:
      field: "message"
      tokenizer: "%{timestamp->} %{+timestamp} %{+timestamp} %{} %{procs->} %{msg}"
      target_prefix: ""
  - timestamp:
      field: "timestamp"
      layouts:
        - "Jan 2 15:04:05"
        - "Jan 02 15:04:05"

2025년 7월 16일 수요일

CentOS7의 Splunk - 3rd

인덱서 서비스 등록. init 서비스로 등록된다.

[root@Splunk splunk]# bin/splunk enable boot-start
Init script installed at /etc/init.d/splunk.
Init script is configured to run at boot.
[root@Splunk splunk]#
[root@Splunk splunk]# ls /etc/init.d/
functions  netconsole  network  README  splunk  sshd
cs

2025년 7월 9일 수요일

스플렁크와 엘라스틱의 인덱싱

경로 정보가 없는 윈도우 auditlog. 검색 결과에 하이라이트 표시가 되어 있다. 스플렁크는 empty값도 인덱싱을 하나?


2025년 6월 27일 금요일

Filebeat의 multi path

filebeat 설정.
filebeat.inputs:
- type: filestream
  id: my-filestream-id
  enabled: true
  paths:
    - d:\firewall.log
  prospector.scanner.fingerprint.enabled: false

filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false

setup.template.settings:
  index.number_of_shards: 1

2025년 6월 21일 토요일

2025년 6월 15일 일요일

CentOS7의 Splunk - 2nd

스플렁크 RPM 설치 실패.

[root@Splunk ~]# rpm -ivh splunk-9.4.3-237ebbd22314.x86_64.rpm
error: splunk-9.4.3-237ebbd22314.x86_64.rpm: headerRead failed: hdr data: BAD, no. of bytes(19932197) out of range
error: splunk-9.4.3-237ebbd22314.x86_64.rpm cannot be installed
cs

헤더 정보를 못 읽는다는 뜻인가? 설치 파일은 문제가 없는 것 같은데?

[root@Splunk ~]# file splunk-9.4.3-237ebbd22314.x86_64.rpm
splunk-9.4.3-237ebbd22314.x86_64.rpm: RPM v3.0 bin i386/x86_64 splunk-9.4.3-237ebbd22314
cs

2025년 6월 14일 토요일

Splunk의 데이터 전처리 - 3rd

스플렁크는 3단계의 윈도우 이벤트 전처리 과정을 제공한다. 이중 wel-eq-kv를 제외한 나머지는 모두 정규표현식으로 동작.

2025년 6월 8일 일요일

데이터 노가다 실수담 - 11th

3개의 필드로 이루어진 테이블. a가 있으면 c가 없고, c가 있으면 a가 없는 구조. 


2025년 5월 22일 목요일

Elasticsearch 9.0의 변화 - 3rd

On master node

클러스터 마스터 노드 설정(elasticsearch.yml).

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["192.168.31.177"]
 

2025년 5월 20일 화요일

Elasticsearch 9.0의 변화 - 2nd

stack mornitoring 실행하니 이런 에러가 뜬다. 개체 암호화키가 필요하다고?

에러 메시지 안 뜰 수도 있음

2025년 5월 14일 수요일

Splunk의 날짜 계산

최근 30일 데이터의 주간 단위 발생 통계. '월~일요일' 단위 집계 결과를 보여준다.


2025년 5월 11일 일요일

Splunk의 unix time

audit.log 연동. 소스타입 선택과 관계 없이 unix time을 잘 인식한다.


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