2023년 8월 6일 일요일

Filebeat system 모듈 - 2nd

같은 ID가 이벤트 성격에 따라 다르게 추출되고 있다.



/usr/share/filebeat/module/system/auth/ingest/pipeline.yml을 살펴보니 user.name 필드 추출 시작 기준인 user 구문이 다르다. 하나는 공백이 없고, 하나는 있음.
  - grok:
      description: Grok specific auth messages.
      tag: grok-specific-messages
      field: _temp.message
      ignore_missing: true
      patterns:
        - '^%{DATA:system.auth.ssh.event} %{DATA:system.auth.ssh.method} for (invalid user)?%{DATA:user.name} from %{IPORHOST:source.address} port %{NUMBER:source.port:long} ssh2(: %{GREEDYDATA:system.auth.ssh.signature})?'
        - '^%{DATA:system.auth.ssh.event} user %{DATA:user.name} from %{IPORHOST:source.address}'

수정 전:
  - grok:
      description: Grok specific auth messages.
      tag: grok-specific-messages
      field: _temp.message
      ignore_missing: true
      patterns:
        - '^%{DATA:system.auth.ssh.event} %{DATA:system.auth.ssh.method} for (invalid user)?%{DATA:user.name} from %{IPORHOST:source.address} port %{NUMBER:source.port:long} ssh2(: %{GREEDYDATA:system.auth.ssh.signature})?'

수정 후:
  - grok:
      description: Grok specific auth messages.
      tag: grok-specific-messages
      field: _temp.message
      ignore_missing: true
      patterns:
        - '^%{DATA:system.auth.ssh.event} %{DATA:system.auth.ssh.method} for (invalid user )?%{DATA:user.name} from %{IPORHOST:source.address} port %{NUMBER:source.port:long} ssh2(: %{GREEDYDATA:system.auth.ssh.signature})?'

수정 결과:


리인덱싱 전에 기존 등록된 인제스트 파이프라인 삭제 및 filebeat.yml 수정 필수. winlogbeat는 왜 같은 옵션이 없을까?


관련 글

댓글 없음:

댓글 쓰기

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