• 로그인

사용자의 편의를 위해 제공되는 기계 번역입니다.

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

NerdGraph 튜토리얼: 데이터 파티션 규칙 관리

api.newrelic.com/graphiql에서 NerdGraph 를 사용하여 로그에 대한 데이터 파티션 규칙 을 생성, 쿼리 및 관리할 수 있습니다. NerdGraph는 GraphQL 형식 API 탐색기입니다.

데이터 파티션 규칙 스키마

사용 가능한 데이터 파티션 규칙 필드는 다음과 같습니다.

필드

설명

id

고유한 데이터 파티션 규칙 식별자입니다.

대상 데이터 파티션

데이터 파티션의 이름입니다.

description

이 데이터 파티션 규칙이 나타내는 내용에 대한 설명입니다.

매칭 기준

이 데이터 파티션 규칙에 대한 일치 기준입니다. 규칙이 활성화되면 이 기준과 일치하는 로그가 지정된 데이터 파티션으로 라우팅됩니다.

보존 정책

데이터 파티션 데이터의 보존 정책입니다.

createdAt

규칙이 생성된 날짜 및 시간입니다.

만든이

규칙을 만든 사용자입니다.

updatedAt

규칙이 마지막으로 변경된 날짜 및 시간입니다.

업데이트한 사람

규칙을 마지막으로 업데이트한 사용자입니다.

활성화

이 데이터 파티션 규칙이 활성화되었는지 여부.

삭제됨

이 데이터 파티션 규칙이 삭제되었는지 여부. 데이터 파티션 규칙을 삭제해도 이미 라우팅된 로그는 삭제되지 않습니다.

데이터 파티션 규칙의 쿼리 예

이 NerdGraph API 요청 예제는 주어진 계정에 대한 모든 데이터 파티션 규칙을 가져옵니다. 이 예에서는 몇 개의 필드만 요청합니다.

{
actor {
account(id: 123456) {
logConfigurations {
dataPartitionRules {
id
targetDataPartition
description
matchingCriteria {
attributeName
matchingOperator
matchingExpression
}
}
}
}
}
}

데이터 파티션 규칙 생성

이 예에서는 새 데이터 파티션 규칙을 생성합니다. 규칙을 만들기 전에 파티션으로 데이터를 구성하는 방법 에 대한 설명서를 검토하세요.

mutation {
logConfigurationsCreateDataPartitionRule(
accountId: 1123456,
rule: {
targetDataPartition: "Log_aNewDataPartitionRule",
description: "Example data partition rule",
matchingCriteria: {
attributeName: "attribute",
matchingMethod: LIKE,
matchingExpression: "'%example%'"
},
retentionPolicy: STANDARD,
enabled: true
}) {
rule {
id
targetDataPartition
description
}
errors {
message
type
}
}
}

데이터 파티션 규칙 업데이트

이 예는 지정된 ID가 "123" 인 데이터 파티션 규칙을 업데이트합니다. 업데이트할 수 있는 필드는 description , matchingCriteriaenabled 입니다. 모두 선택 사항이므로 업데이트하려는 항목만 사용하면 됩니다.

mutation {
logConfigurationsUpdateDataPartitionRule(
accountId: 1123456,
rule: {
id: "123",
description: "Example data partition rule",
matchingCriteria: {
attributeName: "attribute",
matchingMethod: LIKE,
matchingExpression: "'%example%'"
},
enabled: true
}) {
rule {
id
targetDataPartition
description
}
errors {
message
type
}
}
}

데이터 파티션 규칙 삭제

이 예는 데이터 파티션 규칙을 삭제합니다. 데이터 파티션 규칙을 삭제해도 이미 파티션된 데이터는 삭제되지 않습니다. 해당 데이터는 retentionPolicy 필드에 정의된 지정된 기간 동안 유지됩니다.

mutation {
logConfigurationsDeleteDataPartitionRule(id: "1111", accountId: 123456) {
errors {
message
type
}
}
}
Copyright © 2022 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.