- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
To grant read access on log data at all, you must grant the logs_read_data
permission.
From there you can limit what data a role grants read access to by associating a Restriction Query with that role.
A Restriction Query is a logs query that restricts which logs the logs_read_data
permission grants read access to.
For users whose roles have Restriction Queries, any log query they make only returns those log events that also match
one of their Restriction Queries. This is true whether the user queries log events from any log-related feature, including
the log explorer, Live Tail, re-hydration, or a dashboard widget.
Restriction Queries currently only support use of the following components of log events:
The recommended way to manage restricted read access on log data for customers with large or complicated organizational structures is to add a team tag to log events to indicate which team(s) own(s) them, and then to scope Restriction Queries to the appropriate values of the team tag. Tags can be applied to log events in many ways, and a log event can have multiple tags with the same key (like team) and different values—in this way the same log event can be visible to roles whose restriction queries are scoped to different team values.
You need an API and application key with Admin rights to interact with this endpoint.
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.eu/api/v2/logs/config/restriction_querieshttps://api.ddog-gov.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries
Returns all restriction queries, including their names and IDs.
名前
種類
説明
page[size]
integer
Size for a given page. The maximum allowed value is 100.
page[number]
integer
Specific page number to return.
OK
Response containing information about multiple restriction queries.
フィールド
種類
説明
data
[object]
Array of returned restriction queries.
attributes
object
Attributes of the restriction query.
created_at
date-time
Creation time of the restriction query.
modified_at
date-time
Time of last restriction query modification.
restriction_query
string
The query that defines the restriction. Only the content matching the query can be returned.
id
string
ID of the restriction query.
type
string
Restriction queries type.
default: logs_restriction_queries
{
"data": [
{
"attributes": {
"created_at": "2020-03-17T21:06:44.000Z",
"modified_at": "2020-03-17T21:15:15.000Z",
"restriction_query": "env:sandbox"
},
"id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
"type": "logs_restriction_queries"
}
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
POST https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.eu/api/v2/logs/config/restriction_querieshttps://api.ddog-gov.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries
Create a new restriction query for your organization.
This endpoint requires the user_access_manage
authorization scope.
フィールド
種類
説明
data
object
Data related to the creation of a restriction query.
attributes
object
Attributes of the created restriction query.
restriction_query
string
The restriction query.
type
enum
Restriction query resource type.
Allowed enum values: logs_restriction_queries
default: logs_restriction_queries
{
"data": {
"attributes": {
"restriction_query": "env:sandbox"
},
"type": "logs_restriction_queries"
}
}
OK
Response containing information about a single restriction query.
フィールド
種類
説明
data
object
Restriction query object returned by the API.
attributes
object
Attributes of the restriction query.
created_at
date-time
Creation time of the restriction query.
modified_at
date-time
Time of last restriction query modification.
restriction_query
string
The query that defines the restriction. Only the content matching the query can be returned.
id
string
ID of the restriction query.
type
string
Restriction queries type.
default: logs_restriction_queries
{
"data": {
"attributes": {
"created_at": "2020-03-17T21:06:44.000Z",
"modified_at": "2020-03-17T21:15:15.000Z",
"restriction_query": "env:sandbox"
},
"id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
"type": "logs_restriction_queries"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}
Get a restriction query in the organization specified by the restriction query’s restriction_query_id
.
名前
種類
説明
restriction_query_id [required]
string
The ID of the restriction query.
OK
Response containing information about a single restriction query.
フィールド
種類
説明
data
object
Restriction query object returned by the API.
attributes
object
Attributes of the restriction query.
created_at
date-time
Creation time of the restriction query.
modified_at
date-time
Time of last restriction query modification.
restriction_query
string
The query that defines the restriction. Only the content matching the query can be returned.
id
string
ID of the restriction query.
relationships
object
Relationships of the restriction query object.
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Restriction query resource type.
Allowed enum values: logs_restriction_queries
default: logs_restriction_queries
included
[object <oneOf>]
Array of objects related to the restriction query.
Option 1
object
Partial role object.
attributes
object
Attributes of the role for a restriction query.
name
string
The role name.
id
string
ID of the role.
type
string
Role resource type.
default: roles
{
"data": {
"attributes": {
"created_at": "2020-03-17T21:06:44.000Z",
"modified_at": "2020-03-17T21:15:15.000Z",
"restriction_query": "env:sandbox"
},
"id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
"relationships": {
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "logs_restriction_queries"
},
"included": [
{
"attributes": {
"name": "Datadog Admin Role"
},
"id": "<ROLE_ID>",
"type": "roles"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
PATCH https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}
Edit a restriction query.
This endpoint requires the user_access_manage
authorization scope.
名前
種類
説明
restriction_query_id [required]
string
The ID of the restriction query.
フィールド
種類
説明
data
object
Data related to the update of a restriction query.
attributes
object
Attributes of the edited restriction query.
restriction_query
string
The restriction query.
type
enum
Restriction query resource type.
Allowed enum values: logs_restriction_queries
default: logs_restriction_queries
{
"data": {
"attributes": {
"restriction_query": "env:sandbox"
},
"type": "logs_restriction_queries"
}
}
OK
Response containing information about a single restriction query.
フィールド
種類
説明
data
object
Restriction query object returned by the API.
attributes
object
Attributes of the restriction query.
created_at
date-time
Creation time of the restriction query.
modified_at
date-time
Time of last restriction query modification.
restriction_query
string
The query that defines the restriction. Only the content matching the query can be returned.
id
string
ID of the restriction query.
type
string
Restriction queries type.
default: logs_restriction_queries
{
"data": {
"attributes": {
"created_at": "2020-03-17T21:06:44.000Z",
"modified_at": "2020-03-17T21:15:15.000Z",
"restriction_query": "env:sandbox"
},
"id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
"type": "logs_restriction_queries"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
DELETE https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}
Deletes a restriction query.
This endpoint requires the user_access_manage
authorization scope.
名前
種類
説明
restriction_query_id [required]
string
The ID of the restriction query.
OK
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles
Returns all roles that have a given restriction query.
名前
種類
説明
restriction_query_id [required]
string
The ID of the restriction query.
名前
種類
説明
page[size]
integer
Size for a given page. The maximum allowed value is 100.
page[number]
integer
Specific page number to return.
OK
Response containing information about roles attached to a restriction query.
フィールド
種類
説明
data
[object]
Array of roles.
attributes
object
Attributes of the role for a restriction query.
name
string
The role name.
id
string
ID of the role.
type
string
Role resource type.
default: roles
{
"data": [
{
"attributes": {
"name": "Datadog Admin Role"
},
"id": "<ROLE_ID>",
"type": "roles"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}/roles" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
POST https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles
Adds a role to a restriction query.
This endpoint requires the user_access_manage
authorization scope.
名前
種類
説明
restriction_query_id [required]
string
The ID of the restriction query.
フィールド
種類
説明
data
object
Relationship to role object.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
{
"data": {
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
}
OK
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}/roles" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
DELETE https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles
Removes a role from a restriction query.
This endpoint requires the user_access_manage
authorization scope.
名前
種類
説明
restriction_query_id [required]
string
The ID of the restriction query.
フィールド
種類
説明
data
object
Relationship to role object.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
{
"data": {
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
}
OK
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}/roles" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/user/{user_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}
Get all restriction queries for a given user.
名前
種類
説明
user_id [required]
string
The ID of the user.
OK
Response containing information about multiple restriction queries.
フィールド
種類
説明
data
[object]
Array of returned restriction queries.
attributes
object
Attributes of the restriction query.
created_at
date-time
Creation time of the restriction query.
modified_at
date-time
Time of last restriction query modification.
restriction_query
string
The query that defines the restriction. Only the content matching the query can be returned.
id
string
ID of the restriction query.
type
string
Restriction queries type.
default: logs_restriction_queries
{
"data": [
{
"attributes": {
"created_at": "2020-03-17T21:06:44.000Z",
"modified_at": "2020-03-17T21:15:15.000Z",
"restriction_query": "env:sandbox"
},
"id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
"type": "logs_restriction_queries"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export user_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/user/${user_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.
GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/role/{role_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}
Get restriction query for a given role.
名前
種類
説明
role_id [required]
string
The ID of the role.
OK
Response containing information about multiple restriction queries.
フィールド
種類
説明
data
[object]
Array of returned restriction queries.
attributes
object
Attributes of the restriction query.
created_at
date-time
Creation time of the restriction query.
modified_at
date-time
Time of last restriction query modification.
restriction_query
string
The query that defines the restriction. Only the content matching the query can be returned.
id
string
ID of the restriction query.
type
string
Restriction queries type.
default: logs_restriction_queries
{
"data": [
{
"attributes": {
"created_at": "2020-03-17T21:06:44.000Z",
"modified_at": "2020-03-17T21:15:15.000Z",
"restriction_query": "env:sandbox"
},
"id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
"type": "logs_restriction_queries"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export role_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/role/${role_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"