감사 로그 JSON 스키마#

plans-img Enterprise 플랜 에서 사용 가능

deployment-img self-hosted 배포

감사 로그 JSON 스키마는 필드 이름, 데이터 유형, 객체 및 구조를 포함하여 단일 이벤트가 감사 로그에 기록될 때 어떻게 표시되어야 하는지 일관되게 정의하는 표준화된 청사진 또는 도식으로 기능합니다.

JSON 감사 로깅 스키마의 개요는 아래에 제공됩니다. 자세한 내용은 JSON 데이터 모델 을 참조하세요.

{
    "timestamp": "",       // Event time
    "status": "",          // Success or failure of the audited event or activity
    "event_name": "",      // Logged event name
    "error": {             // Error if status = fail
        "status_code": 0,
        "description": ""
    },
    "actor": {             // The user performing the action
        "user_id": ""           // Unique identifier of the event user
        "session_id": ""        // Unique session identifier of the event user
        "client": ""            // User agent of the client/platform in use by the event user
        "ip_address": ""        // IPv4/IPv6 IP address of the event user
    },
    "event": {             // Event-specific data
        "parameters": {}        // Map containing parameters of the audited event or activity
        "prior_state": {}       // Pre-event state of the object
        "resulting_state": {}   // Post-event state of the object
        "object_type": ""       // Object targeted by the event or activity
    },
    "meta": {
        "api_path": "",         // API endpoint interacted with for event or activity
        "cluster_id": ""        // Unique identifier of the cluster in use by the event user
    }
}

감사 로그 레코드 예시#

사용자 환경설정 업데이트#

{
    "timestamp": "2022-08-17 20:37:52.846 +01:00",
    "event_name": "updatePreferences",
    "status": "success",
    "actor": {
        "user_id": "aw8ehkwaziytzry1qqxi9tsqwh",
        "session_id": "kth3jyadc3b1p84kbz6y3o75na",
        "client": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Safari/605.1.15",
        "ip_address": "192.168.0.169"
    },
    "event": {
        "parameters": {},
        "prior_state": {},
        "resulting_state": {},
        "object_type": ""
    },
    "meta": {
        "api_path": "/api/v4/users/aw8ehkwaziytzry1qqxi9tsqwh/preferences",
        "cluster_id": "8dxdbfx6fpdwtki1z6n8whtkho"
    },
    "error": {}
}

JSON 데이터 모델#

이름

유형

설명

타임스탬프

int64

이벤트나 활동이 발생한 날짜/시간

Mattermost는 현재 세 가지 로그 형식을 지원합니다: plain, JSON, GELF

  • Plain 로그 형식은 기본적으로 RFC3339 를 사용합니다. 지원되는 옵션에 대한 자세한 내용은 plain 로그 형식 구성 문서를 참조하세요.

  • JSON 로그 형식은 기본적으로 RFC3339 를 사용합니다. 지원되는 옵션에 대한 자세한 내용은 JSON 로그 형식 구성 문서를 참조하세요.

  • GELF 로그 형식은 unixtime 를 사용합니다. 지원되는 옵션에 대한 자세한 내용은 GELF 로그 형식 구성 문서를 참조하세요.

이벤트_이름

문자열

발생하는 이벤트 유형의 고유 이름 및 식별자 (예: getLogs, requestRenewalLink, createTeam, createChannel, deleteChannel 또는 extendSessionExpiry).

상태

문자열

감사된 이벤트의 성공 또는 실패.

이벤트

EventData

이벤트 매개변수 및 객체 상태.

행위자

EventActor

이벤트와 관련된 사용자.

메타

EventMeta

관련 이벤트 메타데이터.

오류

EventError

상태가 실패 상태일 경우 발생하는 오류.

이벤트 데이터#

필드 이름

데이터 유형

설명

매개변수

요청의 일부로 처리되는 페이로드 및 매개변수.

prior_state

수정 중인 엔티티의 이전 상태. 이전 상태가 없는 경우 null.

resulting_state

생성 또는 수정 후의 결과 엔티티.

object_type

문자열

엔티티 유형의 문자열 표현(예: post)

EventActor#

필드 이름

데이터 유형

설명

user_id

문자열

이벤트 실행자의 고유 식별자.

session_id

문자열

이벤트 실행자의 고유 세션 식별자.

client

문자열

이벤트 실행자가 사용 중인 클라이언트/플랫폼의 사용자 에이전트.

ip_address

문자열

이벤트 실행자의 IPv4/IPv6 IP 주소.

EventMeta#

필드 이름

데이터 유형

설명

api_path

문자열

이벤트를 발생시킨 REST 엔드포인트.

cluster_id

정수

클러스터 식별자.

EventError#

필드 이름

데이터 유형

설명

설명

문자열

(선택 사항) 오류 설명.

status_code

정수

(선택 사항) 오류 상태 코드.