- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
ログインデックスのコンフィギュレーションを管理します。 このエンドポイントとやり取りするには、管理者権限を持つ API とアプリケーションキーが必要です。
GET https://api.ap1.datadoghq.com/api/v1/logs/config/indexeshttps://api.datadoghq.eu/api/v1/logs/config/indexeshttps://api.ddog-gov.com/api/v1/logs/config/indexeshttps://api.datadoghq.com/api/v1/logs/config/indexeshttps://api.us3.datadoghq.com/api/v1/logs/config/indexeshttps://api.us5.datadoghq.com/api/v1/logs/config/indexes
インデックスオブジェクトはログインデックスの構成を記述します。
このエンドポイントはオーガニゼーションの LogIndex
オブジェクトの配列を返します。
OK
Object with all Index configurations for a given organization.
フィールド
種類
説明
indexes
[object]
Array of Log index configurations.
daily_limit
int64
The number of log events you can send in this index per day before you are rate-limited.
exclusion_filters
[object]
An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.
filter
object
Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.
query
string
Default query is *
, meaning all logs flowing in the index would be excluded.
Scope down exclusion filter to only a subset of logs with a log query.
sample_rate [required]
double
Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.
is_enabled
boolean
Whether or not the exclusion filter is active.
name [required]
string
Name of the index exclusion filter.
filter [required]
object
Filter for logs.
query
string
The filter query.
is_rate_limited
boolean
A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC.
name [required]
string
The name of the index.
num_retention_days
int64
The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions.
{
"indexes": [
{
"daily_limit": 300000000,
"exclusion_filters": [
{
"filter": {
"query": "*",
"sample_rate": 1
},
"is_enabled": false,
"name": "payment"
}
],
"filter": {
"query": "source:python"
},
"is_rate_limited": false,
"name": "main",
"num_retention_days": 15
}
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"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/v1/logs/config/indexes" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get all indexes returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.logs_indexes_api import LogsIndexesApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = LogsIndexesApi(api_client)
response = api_instance.list_log_indexes()
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get all indexes returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::LogsIndexesAPI.new
p api_instance.list_log_indexes()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get all indexes returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewLogsIndexesApi(apiClient)
resp, r, err := api.ListLogIndexes(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsIndexesApi.ListLogIndexes`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `LogsIndexesApi.ListLogIndexes`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get all indexes returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.LogsIndexesApi;
import com.datadog.api.client.v1.model.LogsIndexListResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);
try {
LogsIndexListResponse result = apiInstance.listLogIndexes();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsIndexesApi#listLogIndexes");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
/**
* Get all indexes returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.LogsIndexesApi(configuration);
apiInstance
.listLogIndexes()
.then((data: v1.LogsIndexListResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v1/logs/config/indexes/{name}https://api.datadoghq.eu/api/v1/logs/config/indexes/{name}https://api.ddog-gov.com/api/v1/logs/config/indexes/{name}https://api.datadoghq.com/api/v1/logs/config/indexes/{name}https://api.us3.datadoghq.com/api/v1/logs/config/indexes/{name}https://api.us5.datadoghq.com/api/v1/logs/config/indexes/{name}
オーガニゼーションからログインデックスを取得します。このエンドポイントは、JSON 引数を受け取りません。
名前
種類
説明
name [required]
string
Name of the log index.
OK
Object describing a Datadog Log index.
フィールド
種類
説明
daily_limit
int64
The number of log events you can send in this index per day before you are rate-limited.
exclusion_filters
[object]
An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.
filter
object
Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.
query
string
Default query is *
, meaning all logs flowing in the index would be excluded.
Scope down exclusion filter to only a subset of logs with a log query.
sample_rate [required]
double
Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.
is_enabled
boolean
Whether or not the exclusion filter is active.
name [required]
string
Name of the index exclusion filter.
filter [required]
object
Filter for logs.
query
string
The filter query.
is_rate_limited
boolean
A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC.
name [required]
string
The name of the index.
num_retention_days
int64
The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions.
{
"daily_limit": 300000000,
"exclusion_filters": [
{
"filter": {
"query": "*",
"sample_rate": 1
},
"is_enabled": false,
"name": "payment"
}
],
"filter": {
"query": "source:python"
},
"is_rate_limited": false,
"name": "main",
"num_retention_days": 15
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Response returned by the Logs API when errors occur.
フィールド
種類
説明
error
object
Error returned by the Logs API
code
string
Code identifying the error
details
[object]
Additional error details
message
string
Error message
{
"error": {
"code": "string",
"details": [],
"message": "string"
}
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export name="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/v1/logs/config/indexes/${name}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get an index returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.logs_indexes_api import LogsIndexesApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = LogsIndexesApi(api_client)
response = api_instance.get_logs_index(
name="name",
)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Get an index returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::LogsIndexesAPI.new
p api_instance.get_logs_index("name")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Get an index returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewLogsIndexesApi(apiClient)
resp, r, err := api.GetLogsIndex(ctx, "name")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsIndexesApi.GetLogsIndex`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `LogsIndexesApi.GetLogsIndex`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Get an index returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.LogsIndexesApi;
import com.datadog.api.client.v1.model.LogsIndex;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);
try {
LogsIndex result = apiInstance.getLogsIndex("name");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsIndexesApi#getLogsIndex");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
/**
* Get an index returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.LogsIndexesApi(configuration);
const params: v1.LogsIndexesApiGetLogsIndexRequest = {
name: "name",
};
apiInstance
.getLogsIndex(params)
.then((data: v1.LogsIndex) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
POST https://api.ap1.datadoghq.com/api/v1/logs/config/indexeshttps://api.datadoghq.eu/api/v1/logs/config/indexeshttps://api.ddog-gov.com/api/v1/logs/config/indexeshttps://api.datadoghq.com/api/v1/logs/config/indexeshttps://api.us3.datadoghq.com/api/v1/logs/config/indexeshttps://api.us5.datadoghq.com/api/v1/logs/config/indexes
新しいインデックスを作成します。リクエストが正常に完了したときに、リクエスト本文で渡される Index オブジェクトを返します。
新しいインデックスを含むオブジェクト。
フィールド
種類
説明
daily_limit
int64
The number of log events you can send in this index per day before you are rate-limited.
exclusion_filters
[object]
An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.
filter
object
Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.
query
string
Default query is *
, meaning all logs flowing in the index would be excluded.
Scope down exclusion filter to only a subset of logs with a log query.
sample_rate [required]
double
Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.
is_enabled
boolean
Whether or not the exclusion filter is active.
name [required]
string
Name of the index exclusion filter.
filter [required]
object
Filter for logs.
query
string
The filter query.
is_rate_limited
boolean
A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC.
name [required]
string
The name of the index.
num_retention_days
int64
The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions.
{
"daily_limit": 300000000,
"exclusion_filters": [
{
"filter": {
"query": "*",
"sample_rate": 1
},
"is_enabled": false,
"name": "payment"
}
],
"filter": {
"query": "source:python"
},
"name": "main",
"num_retention_days": 15
}
OK
Object describing a Datadog Log index.
フィールド
種類
説明
daily_limit
int64
The number of log events you can send in this index per day before you are rate-limited.
exclusion_filters
[object]
An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.
filter
object
Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.
query
string
Default query is *
, meaning all logs flowing in the index would be excluded.
Scope down exclusion filter to only a subset of logs with a log query.
sample_rate [required]
double
Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.
is_enabled
boolean
Whether or not the exclusion filter is active.
name [required]
string
Name of the index exclusion filter.
filter [required]
object
Filter for logs.
query
string
The filter query.
is_rate_limited
boolean
A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC.
name [required]
string
The name of the index.
num_retention_days
int64
The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions.
{
"daily_limit": 300000000,
"exclusion_filters": [
{
"filter": {
"query": "*",
"sample_rate": 1
},
"is_enabled": false,
"name": "payment"
}
],
"filter": {
"query": "source:python"
},
"is_rate_limited": false,
"name": "main",
"num_retention_days": 15
}
Invalid Parameter Error
Response returned by the Logs API when errors occur.
フィールド
種類
説明
error
object
Error returned by the Logs API
code
string
Code identifying the error
details
[object]
Additional error details
message
string
Error message
{
"error": {
"code": "string",
"details": [],
"message": "string"
}
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"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/v1/logs/config/indexes" \
-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
{
"exclusion_filters": [
{
"filter": {
"sample_rate": 1
},
"name": "payment"
}
],
"filter": {},
"name": "main"
}
EOF
"""
Create an index returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.logs_indexes_api import LogsIndexesApi
from datadog_api_client.v1.model.logs_exclusion import LogsExclusion
from datadog_api_client.v1.model.logs_exclusion_filter import LogsExclusionFilter
from datadog_api_client.v1.model.logs_filter import LogsFilter
from datadog_api_client.v1.model.logs_index import LogsIndex
body = LogsIndex(
daily_limit=300000000,
exclusion_filters=[
LogsExclusion(
filter=LogsExclusionFilter(
query="*",
sample_rate=1.0,
),
name="payment",
),
],
filter=LogsFilter(
query="source:python",
),
name="main",
num_retention_days=15,
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = LogsIndexesApi(api_client)
response = api_instance.create_logs_index(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Create an index returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::LogsIndexesAPI.new
body = DatadogAPIClient::V1::LogsIndex.new({
daily_limit: 300000000,
exclusion_filters: [
DatadogAPIClient::V1::LogsExclusion.new({
filter: DatadogAPIClient::V1::LogsExclusionFilter.new({
query: "*",
sample_rate: 1.0,
}),
name: "payment",
}),
],
filter: DatadogAPIClient::V1::LogsFilter.new({
query: "source:python",
}),
name: "main",
num_retention_days: 15,
})
p api_instance.create_logs_index(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Create an index returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
body := datadogV1.LogsIndex{
DailyLimit: datadog.PtrInt64(300000000),
ExclusionFilters: []datadogV1.LogsExclusion{
{
Filter: &datadogV1.LogsExclusionFilter{
Query: datadog.PtrString("*"),
SampleRate: 1.0,
},
Name: "payment",
},
},
Filter: datadogV1.LogsFilter{
Query: datadog.PtrString("source:python"),
},
Name: "main",
NumRetentionDays: datadog.PtrInt64(15),
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewLogsIndexesApi(apiClient)
resp, r, err := api.CreateLogsIndex(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsIndexesApi.CreateLogsIndex`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `LogsIndexesApi.CreateLogsIndex`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Create an index returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.LogsIndexesApi;
import com.datadog.api.client.v1.model.LogsExclusion;
import com.datadog.api.client.v1.model.LogsExclusionFilter;
import com.datadog.api.client.v1.model.LogsFilter;
import com.datadog.api.client.v1.model.LogsIndex;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);
LogsIndex body =
new LogsIndex()
.dailyLimit(300000000L)
.exclusionFilters(
Collections.singletonList(
new LogsExclusion()
.filter(new LogsExclusionFilter().query("*").sampleRate(1.0))
.name("payment")))
.filter(new LogsFilter().query("source:python"))
.name("main")
.numRetentionDays(15L);
try {
LogsIndex result = apiInstance.createLogsIndex(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsIndexesApi#createLogsIndex");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
/**
* Create an index returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.LogsIndexesApi(configuration);
const params: v1.LogsIndexesApiCreateLogsIndexRequest = {
body: {
dailyLimit: 300000000,
exclusionFilters: [
{
filter: {
query: "*",
sampleRate: 1.0,
},
name: "payment",
},
],
filter: {
query: "source:python",
},
name: "main",
numRetentionDays: 15,
},
};
apiInstance
.createLogsIndex(params)
.then((data: v1.LogsIndex) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
PUT https://api.ap1.datadoghq.com/api/v1/logs/config/indexes/{name}https://api.datadoghq.eu/api/v1/logs/config/indexes/{name}https://api.ddog-gov.com/api/v1/logs/config/indexes/{name}https://api.datadoghq.com/api/v1/logs/config/indexes/{name}https://api.us3.datadoghq.com/api/v1/logs/config/indexes/{name}https://api.us5.datadoghq.com/api/v1/logs/config/indexes/{name}
名前による識別に従ってインデックスを更新します。 リクエストが正常に完了したときに、リクエスト本文で渡されるインデックスオブジェクトを返します。
PUT` メソッドを使用すると、現在の構成を Datadog Organization に送信された 新しい構成に置き換えて、インデックス構成が更新されます。
名前
種類
説明
name [required]
string
Name of the log index.
新しい LogsIndexUpdateRequest
を含むオブジェクト。
フィールド
種類
説明
daily_limit
int64
The number of log events you can send in this index per day before you are rate-limited.
disable_daily_limit
boolean
If true, sets the daily_limit
value to null and the index is not limited on a daily basis (any
specified daily_limit
value in the request is ignored). If false or omitted, the index's current
daily_limit
is maintained.
exclusion_filters
[object]
An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.
filter
object
Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.
query
string
Default query is *
, meaning all logs flowing in the index would be excluded.
Scope down exclusion filter to only a subset of logs with a log query.
sample_rate [required]
double
Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.
is_enabled
boolean
Whether or not the exclusion filter is active.
name [required]
string
Name of the index exclusion filter.
filter [required]
object
Filter for logs.
query
string
The filter query.
num_retention_days
int64
The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions.
Note: Changing the retention for an index adjusts the length of retention for all logs already in this index. It may also affect billing.
{
"daily_limit": 300000000,
"disable_daily_limit": false,
"exclusion_filters": [
{
"filter": {
"query": "*",
"sample_rate": 1
},
"is_enabled": false,
"name": "payment"
}
],
"filter": {
"query": "source:python"
},
"num_retention_days": 15
}
OK
Object describing a Datadog Log index.
フィールド
種類
説明
daily_limit
int64
The number of log events you can send in this index per day before you are rate-limited.
exclusion_filters
[object]
An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.
filter
object
Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.
query
string
Default query is *
, meaning all logs flowing in the index would be excluded.
Scope down exclusion filter to only a subset of logs with a log query.
sample_rate [required]
double
Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.
is_enabled
boolean
Whether or not the exclusion filter is active.
name [required]
string
Name of the index exclusion filter.
filter [required]
object
Filter for logs.
query
string
The filter query.
is_rate_limited
boolean
A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC.
name [required]
string
The name of the index.
num_retention_days
int64
The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions.
{
"daily_limit": 300000000,
"exclusion_filters": [
{
"filter": {
"query": "*",
"sample_rate": 1
},
"is_enabled": false,
"name": "payment"
}
],
"filter": {
"query": "source:python"
},
"is_rate_limited": false,
"name": "main",
"num_retention_days": 15
}
Invalid Parameter Error
Response returned by the Logs API when errors occur.
フィールド
種類
説明
error
object
Error returned by the Logs API
code
string
Code identifying the error
details
[object]
Additional error details
message
string
Error message
{
"error": {
"code": "string",
"details": [],
"message": "string"
}
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too Many Requests
Response returned by the Logs API when errors occur.
フィールド
種類
説明
error
object
Error returned by the Logs API
code
string
Code identifying the error
details
[object]
Additional error details
message
string
Error message
{
"error": {
"code": "string",
"details": [],
"message": "string"
}
}
# Path parameters
export name="CHANGE_ME"
# Curl command
curl -X PUT "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/v1/logs/config/indexes/${name}" \
-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
{
"exclusion_filters": [
{
"filter": {
"sample_rate": 1
},
"name": "payment"
}
],
"filter": {}
}
EOF
"""
Update an index returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.logs_indexes_api import LogsIndexesApi
from datadog_api_client.v1.model.logs_exclusion import LogsExclusion
from datadog_api_client.v1.model.logs_exclusion_filter import LogsExclusionFilter
from datadog_api_client.v1.model.logs_filter import LogsFilter
from datadog_api_client.v1.model.logs_index_update_request import LogsIndexUpdateRequest
body = LogsIndexUpdateRequest(
daily_limit=300000000,
disable_daily_limit=False,
exclusion_filters=[
LogsExclusion(
filter=LogsExclusionFilter(
query="*",
sample_rate=1.0,
),
name="payment",
),
],
filter=LogsFilter(
query="source:python",
),
num_retention_days=15,
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = LogsIndexesApi(api_client)
response = api_instance.update_logs_index(name="name", body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Update an index returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::LogsIndexesAPI.new
body = DatadogAPIClient::V1::LogsIndexUpdateRequest.new({
daily_limit: 300000000,
disable_daily_limit: false,
exclusion_filters: [
DatadogAPIClient::V1::LogsExclusion.new({
filter: DatadogAPIClient::V1::LogsExclusionFilter.new({
query: "*",
sample_rate: 1.0,
}),
name: "payment",
}),
],
filter: DatadogAPIClient::V1::LogsFilter.new({
query: "source:python",
}),
num_retention_days: 15,
})
p api_instance.update_logs_index("name", body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Update an index returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
body := datadogV1.LogsIndexUpdateRequest{
DailyLimit: datadog.PtrInt64(300000000),
DisableDailyLimit: datadog.PtrBool(false),
ExclusionFilters: []datadogV1.LogsExclusion{
{
Filter: &datadogV1.LogsExclusionFilter{
Query: datadog.PtrString("*"),
SampleRate: 1.0,
},
Name: "payment",
},
},
Filter: datadogV1.LogsFilter{
Query: datadog.PtrString("source:python"),
},
NumRetentionDays: datadog.PtrInt64(15),
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewLogsIndexesApi(apiClient)
resp, r, err := api.UpdateLogsIndex(ctx, "name", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsIndexesApi.UpdateLogsIndex`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `LogsIndexesApi.UpdateLogsIndex`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Update an index returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.LogsIndexesApi;
import com.datadog.api.client.v1.model.LogsExclusion;
import com.datadog.api.client.v1.model.LogsExclusionFilter;
import com.datadog.api.client.v1.model.LogsFilter;
import com.datadog.api.client.v1.model.LogsIndex;
import com.datadog.api.client.v1.model.LogsIndexUpdateRequest;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);
LogsIndexUpdateRequest body =
new LogsIndexUpdateRequest()
.dailyLimit(300000000L)
.disableDailyLimit(false)
.exclusionFilters(
Collections.singletonList(
new LogsExclusion()
.filter(new LogsExclusionFilter().query("*").sampleRate(1.0))
.name("payment")))
.filter(new LogsFilter().query("source:python"))
.numRetentionDays(15L);
try {
LogsIndex result = apiInstance.updateLogsIndex("name", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsIndexesApi#updateLogsIndex");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
/**
* Update an index returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.LogsIndexesApi(configuration);
const params: v1.LogsIndexesApiUpdateLogsIndexRequest = {
body: {
dailyLimit: 300000000,
disableDailyLimit: false,
exclusionFilters: [
{
filter: {
query: "*",
sampleRate: 1.0,
},
name: "payment",
},
],
filter: {
query: "source:python",
},
numRetentionDays: 15,
},
name: "name",
};
apiInstance
.updateLogsIndex(params)
.then((data: v1.LogsIndex) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v1/logs/config/index-orderhttps://api.datadoghq.eu/api/v1/logs/config/index-orderhttps://api.ddog-gov.com/api/v1/logs/config/index-orderhttps://api.datadoghq.com/api/v1/logs/config/index-orderhttps://api.us3.datadoghq.com/api/v1/logs/config/index-orderhttps://api.us5.datadoghq.com/api/v1/logs/config/index-order
ログインデックスの現在の順序を取得します。このエンドポイントは、JSON 引数を受け取りません。
OK
Object containing the ordered list of log index names.
{
"index_names": [
"main",
"payments",
"web"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"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/v1/logs/config/index-order" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get indexes order returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.logs_indexes_api import LogsIndexesApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = LogsIndexesApi(api_client)
response = api_instance.get_logs_index_order()
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get indexes order returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::LogsIndexesAPI.new
p api_instance.get_logs_index_order()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get indexes order returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewLogsIndexesApi(apiClient)
resp, r, err := api.GetLogsIndexOrder(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsIndexesApi.GetLogsIndexOrder`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `LogsIndexesApi.GetLogsIndexOrder`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get indexes order returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.LogsIndexesApi;
import com.datadog.api.client.v1.model.LogsIndexesOrder;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);
try {
LogsIndexesOrder result = apiInstance.getLogsIndexOrder();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsIndexesApi#getLogsIndexOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
/**
* Get indexes order returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.LogsIndexesApi(configuration);
apiInstance
.getLogsIndexOrder()
.then((data: v1.LogsIndexesOrder) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PUT https://api.ap1.datadoghq.com/api/v1/logs/config/index-orderhttps://api.datadoghq.eu/api/v1/logs/config/index-orderhttps://api.ddog-gov.com/api/v1/logs/config/index-orderhttps://api.datadoghq.com/api/v1/logs/config/index-orderhttps://api.us3.datadoghq.com/api/v1/logs/config/index-orderhttps://api.us5.datadoghq.com/api/v1/logs/config/index-order
このエンドポイントは、オーガニゼーションのインデックス順序を更新します。 リクエストが正常に完了したときに、リクエスト本文で渡される インデックス順序オブジェクトを返します。
新しい順序のインデックス名リストを含むオブジェクト
{
"index_names": [
"main",
"payments",
"web"
]
}
OK
Object containing the ordered list of log index names.
{
"index_names": [
"main",
"payments",
"web"
]
}
Bad Request
Response returned by the Logs API when errors occur.
フィールド
種類
説明
error
object
Error returned by the Logs API
code
string
Code identifying the error
details
[object]
Additional error details
message
string
Error message
{
"error": {
"code": "string",
"details": [],
"message": "string"
}
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X PUT "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/v1/logs/config/index-order" \
-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
{
"index_names": [
"main",
"payments",
"web"
]
}
EOF
"""
Update indexes order returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.logs_indexes_api import LogsIndexesApi
from datadog_api_client.v1.model.logs_indexes_order import LogsIndexesOrder
body = LogsIndexesOrder(
index_names=[
"main",
"payments",
"web",
],
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = LogsIndexesApi(api_client)
response = api_instance.update_logs_index_order(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Update indexes order returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::LogsIndexesAPI.new
body = DatadogAPIClient::V1::LogsIndexesOrder.new({
index_names: [
"main",
"payments",
"web",
],
})
p api_instance.update_logs_index_order(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Update indexes order returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
body := datadogV1.LogsIndexesOrder{
IndexNames: []string{
"main",
"payments",
"web",
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewLogsIndexesApi(apiClient)
resp, r, err := api.UpdateLogsIndexOrder(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsIndexesApi.UpdateLogsIndexOrder`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `LogsIndexesApi.UpdateLogsIndexOrder`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Update indexes order returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.LogsIndexesApi;
import com.datadog.api.client.v1.model.LogsIndexesOrder;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);
LogsIndexesOrder body =
new LogsIndexesOrder().indexNames(Arrays.asList("main", "payments", "web"));
try {
LogsIndexesOrder result = apiInstance.updateLogsIndexOrder(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsIndexesApi#updateLogsIndexOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
/**
* Update indexes order returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.LogsIndexesApi(configuration);
const params: v1.LogsIndexesApiUpdateLogsIndexOrderRequest = {
body: {
indexNames: ["main", "payments", "web"],
},
};
apiInstance
.updateLogsIndexOrder(params)
.then((data: v1.LogsIndexesOrder) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"