Object containing the ordered list of log index names.
Expand All
Field
Type
Description
index_names [required]
[string]
Array of strings identifying by their name(s) the index(es) of your organization.
Logs are tested against the query filter of each index one by one, following the order of the array.
Logs are eventually stored in the first matching index.
"""
Get indexes order returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.logs_indexes_apiimportLogsIndexesApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=LogsIndexesApi(api_client)response=api_instance.get_logs_index_order()print(response)
# Get indexes order returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::LogsIndexesAPI.newpapi_instance.get_logs_index_order()
// Get indexes order 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/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewLogsIndexesApi(apiClient)resp,r,err:=api.GetLogsIndexOrder(ctx)iferr!=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)}
// Get indexes order returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.LogsIndexesApi;importcom.datadog.api.client.v1.model.LogsIndexesOrder;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();LogsIndexesApiapiInstance=newLogsIndexesApi(defaultClient);try{LogsIndexesOrderresult=apiInstance.getLogsIndexOrder();System.out.println(result);}catch(ApiExceptione){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();}}}
// Get indexes order returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=LogsIndexesAPI::with_config(configuration);letresp=api.get_logs_index_order().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get indexes order returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.LogsIndexesApi(configuration);apiInstance.getLogsIndexOrder().then((data: v1.LogsIndexesOrder)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));