An empty list represents no restriction is in place and either all or no tags will be
forwarded depending on forward_tags_restriction_list_type parameter.
default:
forward_tags_restriction_list_type
enum
How forward_tags_restriction_list parameter should be interpreted.
If ALLOW_LIST, then only tags whose keys on the forwarded logs match the ones on the restriction list
are forwarded.
BLOCK_LIST works the opposite way. It does not forward the tags matching the ones on the list.
Allowed enum values: ALLOW_LIST,BLOCK_LIST
default: ALLOW_LIST
forwarder_destination
<oneOf>
A custom destination's location to forward logs.
Option 1
object
The HTTP destination.
auth [required]
<oneOf>
Authentication method of the HTTP requests.
Option 1
object
Basic access authentication.
type [required]
enum
Type of the basic access authentication.
Allowed enum values: basic
default: basic
Option 2
object
Custom header access authentication.
header_name [required]
string
The header name of the authentication.
type [required]
enum
Type of the custom header access authentication.
Allowed enum values: custom_header
default: custom_header
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the HTTP destination.
Allowed enum values: http
default: http
Option 2
object
The Splunk HTTP Event Collector (HEC) destination.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the Splunk HTTP Event Collector (HEC) destination.
Allowed enum values: splunk_hec
default: splunk_hec
Option 3
object
The Elasticsearch destination.
auth [required]
object
Basic access authentication.
<any-key>
Basic access authentication.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
Date pattern with US locale and UTC timezone to be appended to the index name after adding -
(that is, ${index_name}-${indexPattern}).
You can customize the index rotation naming pattern by choosing one of these options:
Hourly: yyyy-MM-dd-HH (as an example, it would render: 2022-10-19-09)
Daily: yyyy-MM-dd (as an example, it would render: 2022-10-19)
Weekly: yyyy-'W'ww (as an example, it would render: 2022-W42)
Monthly: yyyy-MM (as an example, it would render: 2022-10)
If this field is missing or is blank, it means that the index name will always be the same
(that is, no rotation).
type [required]
enum
Type of the Elasticsearch destination.
Allowed enum values: elasticsearch
default: elasticsearch
name
string
The custom destination name.
query
string
The custom destination query filter. Logs matching this query are forwarded to the destination.
id
string
The custom destination ID.
type
enum
The type of the resource. The value should always be custom_destination.
Allowed enum values: custom_destination
"""
Get all custom destinations returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.logs_custom_destinations_apiimportLogsCustomDestinationsApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=LogsCustomDestinationsApi(api_client)response=api_instance.list_logs_custom_destinations()print(response)
# Get all custom destinations returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::LogsCustomDestinationsAPI.newpapi_instance.list_logs_custom_destinations()
// Get all custom destinations returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewLogsCustomDestinationsApi(apiClient)resp,r,err:=api.ListLogsCustomDestinations(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `LogsCustomDestinationsApi.ListLogsCustomDestinations`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `LogsCustomDestinationsApi.ListLogsCustomDestinations`:\n%s\n",responseContent)}
// Get all custom destinations returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=LogsCustomDestinationsAPI::with_config(configuration);letresp=api.list_logs_custom_destinations().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all custom destinations returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);apiInstance.listLogsCustomDestinations().then((data: v2.CustomDestinationsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
An empty list represents no restriction is in place and either all or no tags will be
forwarded depending on forward_tags_restriction_list_type parameter.
default:
forward_tags_restriction_list_type
enum
How forward_tags_restriction_list parameter should be interpreted.
If ALLOW_LIST, then only tags whose keys on the forwarded logs match the ones on the restriction list
are forwarded.
BLOCK_LIST works the opposite way. It does not forward the tags matching the ones on the list.
Allowed enum values: ALLOW_LIST,BLOCK_LIST
default: ALLOW_LIST
forwarder_destination [required]
<oneOf>
A custom destination's location to forward logs.
Option 1
object
The HTTP destination.
auth [required]
<oneOf>
Authentication method of the HTTP requests.
Option 1
object
Basic access authentication.
password [required]
string
The password of the authentication. This field is not returned by the API.
type [required]
enum
Type of the basic access authentication.
Allowed enum values: basic
default: basic
username [required]
string
The username of the authentication. This field is not returned by the API.
Option 2
object
Custom header access authentication.
header_name [required]
string
The header name of the authentication.
header_value [required]
string
The header value of the authentication. This field is not returned by the API.
type [required]
enum
Type of the custom header access authentication.
Allowed enum values: custom_header
default: custom_header
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the HTTP destination.
Allowed enum values: http
default: http
Option 2
object
The Splunk HTTP Event Collector (HEC) destination.
access_token [required]
string
Access token of the Splunk HTTP Event Collector. This field is not returned by the API.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the Splunk HTTP Event Collector (HEC) destination.
Allowed enum values: splunk_hec
default: splunk_hec
Option 3
object
The Elasticsearch destination.
auth [required]
object
Basic access authentication.
password [required]
string
The password of the authentication. This field is not returned by the API.
username [required]
string
The username of the authentication. This field is not returned by the API.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
Date pattern with US locale and UTC timezone to be appended to the index name after adding -
(that is, ${index_name}-${indexPattern}).
You can customize the index rotation naming pattern by choosing one of these options:
Hourly: yyyy-MM-dd-HH (as an example, it would render: 2022-10-19-09)
Daily: yyyy-MM-dd (as an example, it would render: 2022-10-19)
Weekly: yyyy-'W'ww (as an example, it would render: 2022-W42)
Monthly: yyyy-MM (as an example, it would render: 2022-10)
If this field is missing or is blank, it means that the index name will always be the same
(that is, no rotation).
type [required]
enum
Type of the Elasticsearch destination.
Allowed enum values: elasticsearch
default: elasticsearch
name [required]
string
The custom destination name.
query
string
The custom destination query and filter. Logs matching this query are forwarded to the destination.
type [required]
enum
The type of the resource. The value should always be custom_destination.
Allowed enum values: custom_destination
An empty list represents no restriction is in place and either all or no tags will be
forwarded depending on forward_tags_restriction_list_type parameter.
default:
forward_tags_restriction_list_type
enum
How forward_tags_restriction_list parameter should be interpreted.
If ALLOW_LIST, then only tags whose keys on the forwarded logs match the ones on the restriction list
are forwarded.
BLOCK_LIST works the opposite way. It does not forward the tags matching the ones on the list.
Allowed enum values: ALLOW_LIST,BLOCK_LIST
default: ALLOW_LIST
forwarder_destination
<oneOf>
A custom destination's location to forward logs.
Option 1
object
The HTTP destination.
auth [required]
<oneOf>
Authentication method of the HTTP requests.
Option 1
object
Basic access authentication.
type [required]
enum
Type of the basic access authentication.
Allowed enum values: basic
default: basic
Option 2
object
Custom header access authentication.
header_name [required]
string
The header name of the authentication.
type [required]
enum
Type of the custom header access authentication.
Allowed enum values: custom_header
default: custom_header
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the HTTP destination.
Allowed enum values: http
default: http
Option 2
object
The Splunk HTTP Event Collector (HEC) destination.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the Splunk HTTP Event Collector (HEC) destination.
Allowed enum values: splunk_hec
default: splunk_hec
Option 3
object
The Elasticsearch destination.
auth [required]
object
Basic access authentication.
<any-key>
Basic access authentication.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
Date pattern with US locale and UTC timezone to be appended to the index name after adding -
(that is, ${index_name}-${indexPattern}).
You can customize the index rotation naming pattern by choosing one of these options:
Hourly: yyyy-MM-dd-HH (as an example, it would render: 2022-10-19-09)
Daily: yyyy-MM-dd (as an example, it would render: 2022-10-19)
Weekly: yyyy-'W'ww (as an example, it would render: 2022-W42)
Monthly: yyyy-MM (as an example, it would render: 2022-10)
If this field is missing or is blank, it means that the index name will always be the same
(that is, no rotation).
type [required]
enum
Type of the Elasticsearch destination.
Allowed enum values: elasticsearch
default: elasticsearch
name
string
The custom destination name.
query
string
The custom destination query filter. Logs matching this query are forwarded to the destination.
id
string
The custom destination ID.
type
enum
The type of the resource. The value should always be custom_destination.
Allowed enum values: custom_destination
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create a Basic HTTP custom destination returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);constparams: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest={body:{data:{attributes:{enabled: false,forwardTags: false,forwardTagsRestrictionList:["datacenter","host"],forwardTagsRestrictionListType:"ALLOW_LIST",forwarderDestination:{auth:{password:"datadog-custom-destination-password",type:"basic",username:"datadog-custom-destination-username",},endpoint:"https://example.com",type:"http",},name:"Nginx logs",query:"source:nginx",},type:"custom_destination",},},};apiInstance.createLogsCustomDestination(params).then((data: v2.CustomDestinationResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Create a Custom Header HTTP custom destination returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);constparams: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest={body:{data:{attributes:{enabled: false,forwardTags: false,forwardTagsRestrictionList:["datacenter","host"],forwardTagsRestrictionListType:"ALLOW_LIST",forwarderDestination:{auth:{headerValue:"my-secret",type:"custom_header",headerName:"MY-AUTHENTICATION-HEADER",},endpoint:"https://example.com",type:"http",},name:"Nginx logs",query:"source:nginx",},type:"custom_destination",},},};apiInstance.createLogsCustomDestination(params).then((data: v2.CustomDestinationResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Create a Splunk custom destination returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);constparams: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest={body:{data:{attributes:{enabled: false,forwardTags: false,forwardTagsRestrictionList:["datacenter","host"],forwardTagsRestrictionListType:"ALLOW_LIST",forwarderDestination:{accessToken:"my-access-token",endpoint:"https://example.com",type:"splunk_hec",},name:"Nginx logs",query:"source:nginx",},type:"custom_destination",},},};apiInstance.createLogsCustomDestination(params).then((data: v2.CustomDestinationResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
An empty list represents no restriction is in place and either all or no tags will be
forwarded depending on forward_tags_restriction_list_type parameter.
default:
forward_tags_restriction_list_type
enum
How forward_tags_restriction_list parameter should be interpreted.
If ALLOW_LIST, then only tags whose keys on the forwarded logs match the ones on the restriction list
are forwarded.
BLOCK_LIST works the opposite way. It does not forward the tags matching the ones on the list.
Allowed enum values: ALLOW_LIST,BLOCK_LIST
default: ALLOW_LIST
forwarder_destination
<oneOf>
A custom destination's location to forward logs.
Option 1
object
The HTTP destination.
auth [required]
<oneOf>
Authentication method of the HTTP requests.
Option 1
object
Basic access authentication.
type [required]
enum
Type of the basic access authentication.
Allowed enum values: basic
default: basic
Option 2
object
Custom header access authentication.
header_name [required]
string
The header name of the authentication.
type [required]
enum
Type of the custom header access authentication.
Allowed enum values: custom_header
default: custom_header
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the HTTP destination.
Allowed enum values: http
default: http
Option 2
object
The Splunk HTTP Event Collector (HEC) destination.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the Splunk HTTP Event Collector (HEC) destination.
Allowed enum values: splunk_hec
default: splunk_hec
Option 3
object
The Elasticsearch destination.
auth [required]
object
Basic access authentication.
<any-key>
Basic access authentication.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
Date pattern with US locale and UTC timezone to be appended to the index name after adding -
(that is, ${index_name}-${indexPattern}).
You can customize the index rotation naming pattern by choosing one of these options:
Hourly: yyyy-MM-dd-HH (as an example, it would render: 2022-10-19-09)
Daily: yyyy-MM-dd (as an example, it would render: 2022-10-19)
Weekly: yyyy-'W'ww (as an example, it would render: 2022-W42)
Monthly: yyyy-MM (as an example, it would render: 2022-10)
If this field is missing or is blank, it means that the index name will always be the same
(that is, no rotation).
type [required]
enum
Type of the Elasticsearch destination.
Allowed enum values: elasticsearch
default: elasticsearch
name
string
The custom destination name.
query
string
The custom destination query filter. Logs matching this query are forwarded to the destination.
id
string
The custom destination ID.
type
enum
The type of the resource. The value should always be custom_destination.
Allowed enum values: custom_destination
"""
Get a custom destination returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.logs_custom_destinations_apiimportLogsCustomDestinationsApi# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=environ["CUSTOM_DESTINATION_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=LogsCustomDestinationsApi(api_client)response=api_instance.get_logs_custom_destination(custom_destination_id=CUSTOM_DESTINATION_DATA_ID,)print(response)
# Get a custom destination returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::LogsCustomDestinationsAPI.new# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=ENV["CUSTOM_DESTINATION_DATA_ID"]papi_instance.get_logs_custom_destination(CUSTOM_DESTINATION_DATA_ID)
// Get a custom destination returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "custom_destination" in the system
CustomDestinationDataID:=os.Getenv("CUSTOM_DESTINATION_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewLogsCustomDestinationsApi(apiClient)resp,r,err:=api.GetLogsCustomDestination(ctx,CustomDestinationDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `LogsCustomDestinationsApi.GetLogsCustomDestination`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `LogsCustomDestinationsApi.GetLogsCustomDestination`:\n%s\n",responseContent)}
// Get a custom destination returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.LogsCustomDestinationsApi;importcom.datadog.api.client.v2.model.CustomDestinationResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();LogsCustomDestinationsApiapiInstance=newLogsCustomDestinationsApi(defaultClient);// there is a valid "custom_destination" in the systemStringCUSTOM_DESTINATION_DATA_ID=System.getenv("CUSTOM_DESTINATION_DATA_ID");try{CustomDestinationResponseresult=apiInstance.getLogsCustomDestination(CUSTOM_DESTINATION_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling LogsCustomDestinationsApi#getLogsCustomDestination");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a custom destination returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;#[tokio::main]asyncfnmain(){// there is a valid "custom_destination" in the system
letcustom_destination_data_id=std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=LogsCustomDestinationsAPI::with_config(configuration);letresp=api.get_logs_custom_destination(custom_destination_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get a custom destination returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);// there is a valid "custom_destination" in the system
constCUSTOM_DESTINATION_DATA_ID=process.env.CUSTOM_DESTINATION_DATA_IDasstring;constparams: v2.LogsCustomDestinationsApiGetLogsCustomDestinationRequest={customDestinationId: CUSTOM_DESTINATION_DATA_ID,};apiInstance.getLogsCustomDestination(params).then((data: v2.CustomDestinationResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
The attributes associated with the custom destination.
enabled
boolean
Whether logs matching this custom destination should be forwarded or not.
default: true
forward_tags
boolean
Whether tags from the forwarded logs should be forwarded or not.
default: true
forward_tags_restriction_list
[string]
List of keys of tags to be restricted from being forwarded.
An empty list represents no restriction is in place and either all or no tags will be forwarded depending on forward_tags_restriction_list_type parameter.
default:
forward_tags_restriction_list_type
enum
How forward_tags_restriction_list parameter should be interpreted.
If ALLOW_LIST, then only tags whose keys on the forwarded logs match the ones on the restriction list
are forwarded.
BLOCK_LIST works the opposite way. It does not forward the tags matching the ones on the list.
Allowed enum values: ALLOW_LIST,BLOCK_LIST
default: ALLOW_LIST
forwarder_destination
<oneOf>
A custom destination's location to forward logs.
Option 1
object
The HTTP destination.
auth [required]
<oneOf>
Authentication method of the HTTP requests.
Option 1
object
Basic access authentication.
password [required]
string
The password of the authentication. This field is not returned by the API.
type [required]
enum
Type of the basic access authentication.
Allowed enum values: basic
default: basic
username [required]
string
The username of the authentication. This field is not returned by the API.
Option 2
object
Custom header access authentication.
header_name [required]
string
The header name of the authentication.
header_value [required]
string
The header value of the authentication. This field is not returned by the API.
type [required]
enum
Type of the custom header access authentication.
Allowed enum values: custom_header
default: custom_header
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the HTTP destination.
Allowed enum values: http
default: http
Option 2
object
The Splunk HTTP Event Collector (HEC) destination.
access_token [required]
string
Access token of the Splunk HTTP Event Collector. This field is not returned by the API.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the Splunk HTTP Event Collector (HEC) destination.
Allowed enum values: splunk_hec
default: splunk_hec
Option 3
object
The Elasticsearch destination.
auth [required]
object
Basic access authentication.
password [required]
string
The password of the authentication. This field is not returned by the API.
username [required]
string
The username of the authentication. This field is not returned by the API.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
Date pattern with US locale and UTC timezone to be appended to the index name after adding -
(that is, ${index_name}-${indexPattern}).
You can customize the index rotation naming pattern by choosing one of these options:
Hourly: yyyy-MM-dd-HH (as an example, it would render: 2022-10-19-09)
Daily: yyyy-MM-dd (as an example, it would render: 2022-10-19)
Weekly: yyyy-'W'ww (as an example, it would render: 2022-W42)
Monthly: yyyy-MM (as an example, it would render: 2022-10)
If this field is missing or is blank, it means that the index name will always be the same
(that is, no rotation).
type [required]
enum
Type of the Elasticsearch destination.
Allowed enum values: elasticsearch
default: elasticsearch
name
string
The custom destination name.
query
string
The custom destination query and filter. Logs matching this query are forwarded to the destination.
id [required]
string
The custom destination ID.
type [required]
enum
The type of the resource. The value should always be custom_destination.
Allowed enum values: custom_destination
An empty list represents no restriction is in place and either all or no tags will be
forwarded depending on forward_tags_restriction_list_type parameter.
default:
forward_tags_restriction_list_type
enum
How forward_tags_restriction_list parameter should be interpreted.
If ALLOW_LIST, then only tags whose keys on the forwarded logs match the ones on the restriction list
are forwarded.
BLOCK_LIST works the opposite way. It does not forward the tags matching the ones on the list.
Allowed enum values: ALLOW_LIST,BLOCK_LIST
default: ALLOW_LIST
forwarder_destination
<oneOf>
A custom destination's location to forward logs.
Option 1
object
The HTTP destination.
auth [required]
<oneOf>
Authentication method of the HTTP requests.
Option 1
object
Basic access authentication.
type [required]
enum
Type of the basic access authentication.
Allowed enum values: basic
default: basic
Option 2
object
Custom header access authentication.
header_name [required]
string
The header name of the authentication.
type [required]
enum
Type of the custom header access authentication.
Allowed enum values: custom_header
default: custom_header
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the HTTP destination.
Allowed enum values: http
default: http
Option 2
object
The Splunk HTTP Event Collector (HEC) destination.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
type [required]
enum
Type of the Splunk HTTP Event Collector (HEC) destination.
Allowed enum values: splunk_hec
default: splunk_hec
Option 3
object
The Elasticsearch destination.
auth [required]
object
Basic access authentication.
<any-key>
Basic access authentication.
endpoint [required]
string
The destination for which logs will be forwarded to.
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
Date pattern with US locale and UTC timezone to be appended to the index name after adding -
(that is, ${index_name}-${indexPattern}).
You can customize the index rotation naming pattern by choosing one of these options:
Hourly: yyyy-MM-dd-HH (as an example, it would render: 2022-10-19-09)
Daily: yyyy-MM-dd (as an example, it would render: 2022-10-19)
Weekly: yyyy-'W'ww (as an example, it would render: 2022-W42)
Monthly: yyyy-MM (as an example, it would render: 2022-10)
If this field is missing or is blank, it means that the index name will always be the same
(that is, no rotation).
type [required]
enum
Type of the Elasticsearch destination.
Allowed enum values: elasticsearch
default: elasticsearch
name
string
The custom destination name.
query
string
The custom destination query filter. Logs matching this query are forwarded to the destination.
id
string
The custom destination ID.
type
enum
The type of the resource. The value should always be custom_destination.
Allowed enum values: custom_destination
// Update a custom destination returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "custom_destination" in the system
CustomDestinationDataID:=os.Getenv("CUSTOM_DESTINATION_DATA_ID")body:=datadogV2.CustomDestinationUpdateRequest{Data:&datadogV2.CustomDestinationUpdateRequestDefinition{Attributes:&datadogV2.CustomDestinationUpdateRequestAttributes{Name:datadog.PtrString("Nginx logs (Updated)"),Query:datadog.PtrString("source:nginx"),Enabled:datadog.PtrBool(false),ForwardTags:datadog.PtrBool(false),ForwardTagsRestrictionListType:datadogV2.CUSTOMDESTINATIONATTRIBUTETAGSRESTRICTIONLISTTYPE_BLOCK_LIST.Ptr(),},Type:datadogV2.CUSTOMDESTINATIONTYPE_CUSTOM_DESTINATION,Id:CustomDestinationDataID,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewLogsCustomDestinationsApi(apiClient)resp,r,err:=api.UpdateLogsCustomDestination(ctx,CustomDestinationDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `LogsCustomDestinationsApi.UpdateLogsCustomDestination`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `LogsCustomDestinationsApi.UpdateLogsCustomDestination`:\n%s\n",responseContent)}
// Update a custom destination returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.LogsCustomDestinationsApi;importcom.datadog.api.client.v2.model.CustomDestinationAttributeTagsRestrictionListType;importcom.datadog.api.client.v2.model.CustomDestinationResponse;importcom.datadog.api.client.v2.model.CustomDestinationType;importcom.datadog.api.client.v2.model.CustomDestinationUpdateRequest;importcom.datadog.api.client.v2.model.CustomDestinationUpdateRequestAttributes;importcom.datadog.api.client.v2.model.CustomDestinationUpdateRequestDefinition;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();LogsCustomDestinationsApiapiInstance=newLogsCustomDestinationsApi(defaultClient);// there is a valid "custom_destination" in the systemStringCUSTOM_DESTINATION_DATA_ID=System.getenv("CUSTOM_DESTINATION_DATA_ID");CustomDestinationUpdateRequestbody=newCustomDestinationUpdateRequest().data(newCustomDestinationUpdateRequestDefinition().attributes(newCustomDestinationUpdateRequestAttributes().name("Nginx logs (Updated)").query("source:nginx").enabled(false).forwardTags(false).forwardTagsRestrictionListType(CustomDestinationAttributeTagsRestrictionListType.BLOCK_LIST)).type(CustomDestinationType.CUSTOM_DESTINATION).id(CUSTOM_DESTINATION_DATA_ID));try{CustomDestinationResponseresult=apiInstance.updateLogsCustomDestination(CUSTOM_DESTINATION_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling LogsCustomDestinationsApi#updateLogsCustomDestination");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update a custom destination returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.logs_custom_destinations_apiimportLogsCustomDestinationsApifromdatadog_api_client.v2.model.custom_destination_attribute_tags_restriction_list_typeimport(CustomDestinationAttributeTagsRestrictionListType,)fromdatadog_api_client.v2.model.custom_destination_typeimportCustomDestinationTypefromdatadog_api_client.v2.model.custom_destination_update_requestimportCustomDestinationUpdateRequestfromdatadog_api_client.v2.model.custom_destination_update_request_attributesimport(CustomDestinationUpdateRequestAttributes,)fromdatadog_api_client.v2.model.custom_destination_update_request_definitionimport(CustomDestinationUpdateRequestDefinition,)# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=environ["CUSTOM_DESTINATION_DATA_ID"]body=CustomDestinationUpdateRequest(data=CustomDestinationUpdateRequestDefinition(attributes=CustomDestinationUpdateRequestAttributes(name="Nginx logs (Updated)",query="source:nginx",enabled=False,forward_tags=False,forward_tags_restriction_list_type=CustomDestinationAttributeTagsRestrictionListType.BLOCK_LIST,),type=CustomDestinationType.CUSTOM_DESTINATION,id=CUSTOM_DESTINATION_DATA_ID,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=LogsCustomDestinationsApi(api_client)response=api_instance.update_logs_custom_destination(custom_destination_id=CUSTOM_DESTINATION_DATA_ID,body=body)print(response)
# Update a custom destination returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::LogsCustomDestinationsAPI.new# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=ENV["CUSTOM_DESTINATION_DATA_ID"]body=DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({data:DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({attributes:DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({name:"Nginx logs (Updated)",query:"source:nginx",enabled:false,forward_tags:false,forward_tags_restriction_list_type:DatadogAPIClient::V2::CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,}),type:DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION,id:CUSTOM_DESTINATION_DATA_ID,}),})papi_instance.update_logs_custom_destination(CUSTOM_DESTINATION_DATA_ID,body)
// Update a custom destination returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;usedatadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType;usedatadog_api_client::datadogV2::model::CustomDestinationType;usedatadog_api_client::datadogV2::model::CustomDestinationUpdateRequest;usedatadog_api_client::datadogV2::model::CustomDestinationUpdateRequestAttributes;usedatadog_api_client::datadogV2::model::CustomDestinationUpdateRequestDefinition;#[tokio::main]asyncfnmain(){// there is a valid "custom_destination" in the system
letcustom_destination_data_id=std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();letbody=CustomDestinationUpdateRequest::new().data(CustomDestinationUpdateRequestDefinition::new(custom_destination_data_id.clone(),CustomDestinationType::CUSTOM_DESTINATION,).attributes(CustomDestinationUpdateRequestAttributes::new().enabled(false).forward_tags(false).forward_tags_restriction_list_type(CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,).name("Nginx logs (Updated)".to_string()).query("source:nginx".to_string()),),);letconfiguration=datadog::Configuration::new();letapi=LogsCustomDestinationsAPI::with_config(configuration);letresp=api.update_logs_custom_destination(custom_destination_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Update a custom destination returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);// there is a valid "custom_destination" in the system
constCUSTOM_DESTINATION_DATA_ID=process.env.CUSTOM_DESTINATION_DATA_IDasstring;constparams: v2.LogsCustomDestinationsApiUpdateLogsCustomDestinationRequest={body:{data:{attributes:{name:"Nginx logs (Updated)",query:"source:nginx",enabled: false,forwardTags: false,forwardTagsRestrictionListType:"BLOCK_LIST",},type:"custom_destination",id: CUSTOM_DESTINATION_DATA_ID,},},customDestinationId: CUSTOM_DESTINATION_DATA_ID,};apiInstance.updateLogsCustomDestination(params).then((data: v2.CustomDestinationResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete a custom destination returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.logs_custom_destinations_apiimportLogsCustomDestinationsApi# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=environ["CUSTOM_DESTINATION_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=LogsCustomDestinationsApi(api_client)api_instance.delete_logs_custom_destination(custom_destination_id=CUSTOM_DESTINATION_DATA_ID,)
# Delete a custom destination returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::LogsCustomDestinationsAPI.new# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=ENV["CUSTOM_DESTINATION_DATA_ID"]api_instance.delete_logs_custom_destination(CUSTOM_DESTINATION_DATA_ID)
// Delete a custom destination returns "OK" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "custom_destination" in the system
CustomDestinationDataID:=os.Getenv("CUSTOM_DESTINATION_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewLogsCustomDestinationsApi(apiClient)r,err:=api.DeleteLogsCustomDestination(ctx,CustomDestinationDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `LogsCustomDestinationsApi.DeleteLogsCustomDestination`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete a custom destination returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.LogsCustomDestinationsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();LogsCustomDestinationsApiapiInstance=newLogsCustomDestinationsApi(defaultClient);// there is a valid "custom_destination" in the systemStringCUSTOM_DESTINATION_DATA_ID=System.getenv("CUSTOM_DESTINATION_DATA_ID");try{apiInstance.deleteLogsCustomDestination(CUSTOM_DESTINATION_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling LogsCustomDestinationsApi#deleteLogsCustomDestination");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete a custom destination returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;#[tokio::main]asyncfnmain(){// there is a valid "custom_destination" in the system
letcustom_destination_data_id=std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=LogsCustomDestinationsAPI::with_config(configuration);letresp=api.delete_logs_custom_destination(custom_destination_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete a custom destination returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);// there is a valid "custom_destination" in the system
constCUSTOM_DESTINATION_DATA_ID=process.env.CUSTOM_DESTINATION_DATA_IDasstring;constparams: v2.LogsCustomDestinationsApiDeleteLogsCustomDestinationRequest={customDestinationId: CUSTOM_DESTINATION_DATA_ID,};apiInstance.deleteLogsCustomDestination(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));