Get all aggregated DNS traffic.
This endpoint requires the network_connections_read permission.
OAuth apps require the network_connections_read authorization scope to access this endpoint.
Arguments
Query Strings
Name
Type
Description
from
integer
Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window is 15 minutes before the to timestamp. If neither from nor to are provided, the query window is [now - 15m, now].
to
integer
Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither from nor to are provided, the query window is [now - 15m, now].
group_by
string
Comma-separated list of fields to group DNS traffic by. The server side defaults to network.dns_query if unspecified. server_ungrouped may be used if groups are not desired. The maximum number of group_by(s) is 10.
tags
string
Comma-separated list of tags to filter DNS traffic by.
query
string
Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the tags parameter.
limit
integer
The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100.
The metric key for DNS metrics.
Allowed enum values: dns_total_requests,dns_failures,dns_successful_responses,dns_failed_responses,dns_timeouts,dns_responses.nxdomain,dns_responses.servfail,dns_responses.other,dns_success_latency_percentile,dns_failure_latency_percentile
value
int64
The metric value.
id
string
A unique identifier for the aggregated DNS traffic based on the group by values.
type
enum
Aggregated DNS resource type.
Allowed enum values: aggregated_dns
"""
Get all aggregated DNS traffic returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.cloud_network_monitoring_apiimportCloudNetworkMonitoringApiconfiguration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]withApiClient(configuration)asapi_client:api_instance=CloudNetworkMonitoringApi(api_client)response=api_instance.get_aggregated_dns()print(response)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# Get all aggregated DNS traffic returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]endapi_instance=DatadogAPIClient::V2::CloudNetworkMonitoringAPI.newpapi_instance.get_aggregated_dns()
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// Get all aggregated DNS traffic returns "OK" responsepackagemainimport("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())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCloudNetworkMonitoringApi(apiClient)resp,r,err:=api.GetAggregatedDns(ctx,*datadogV2.NewGetAggregatedDnsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CloudNetworkMonitoringApi.GetAggregatedDns`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CloudNetworkMonitoringApi.GetAggregatedDns`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// Get all aggregated DNS traffic returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.CloudNetworkMonitoringApi;importcom.datadog.api.client.v2.model.SingleAggregatedDnsResponseArray;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));CloudNetworkMonitoringApiapiInstance=newCloudNetworkMonitoringApi(defaultClient);try{SingleAggregatedDnsResponseArrayresult=apiInstance.getAggregatedDns();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CloudNetworkMonitoringApi#getAggregatedDns");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// Get all aggregated DNS traffic returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_cloud_network_monitoring::CloudNetworkMonitoringAPI;usedatadog_api_client::datadogV2::api_cloud_network_monitoring::GetAggregatedDnsOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=CloudNetworkMonitoringAPI::with_config(configuration);letresp=api.get_aggregated_dns(GetAggregatedDnsOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get all aggregated DNS traffic returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});constapiInstance=newv2.CloudNetworkMonitoringApi(configuration);apiInstance.getAggregatedDns().then((data: v2.SingleAggregatedDnsResponseArray)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.