For the complete documentation index, see llms.txt. This page is also available as Markdown.

XQL Query

Run XQL queries on your data sources using a series of APIs.

Start an XQL query

post

Execute an XQL query.

For more information on how to run XQL queries, see Run XQL Query APIs.

Note

To ensure you don't surpass your quota, Cortex allows you to run up to four API queries in parallel.

Required license: Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

Header parameters
AuthorizationstringRequired

{api_key}

x-xdr-auth-idstringRequired

{api_key_id}

Body
Responses
200

Successful response

application/json
replystringOptional
post/public_api/v1/xql/start_xql_query
POST /public_api/v1/xql/start_xql_query HTTP/1.1
Host: api-yourfqdn
Authorization: text
x-xdr-auth-id: text
Content-Type: application/json
Accept: */*
Content-Length: 168

{
  "request_data": {
    "query": "dataset=xdr_data | fields event_id, event_type, event_sub_type | limit 3",
    "tenants": [],
    "timeframe": {
      "from": 1598907600000,
      "to": 1599080399000
    }
  }
}
{
  "reply": "ad21c1e1492d4c_667_inv"
}

Get XQL query results

post

Retrieve results of an executed XQL query API.

Note: This endpoint only works on XQL queries initiated by /public_api/v1/xql/start_xql_query/.

Maximum result set size is 1000. The API does not support pagination, therefore, you can set values to determine the result size limitation and how to wait for the results. To view response with greater than 1000 results you must call Get XQL query results Stream.

For more information on how to run XQL queries, see Run XQL Query APIs.

Note

To ensure you don't surpass your quota, Cortex allows you to run up to four API queries in parallel.

Required license: Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

Header parameters
AuthorizationstringRequired

{api_key}

x-xdr-auth-idstringRequired

{api_key_id}

Body
Responses
200

Successful response

application/json
post/public_api/v1/xql/get_query_results
POST /public_api/v1/xql/get_query_results HTTP/1.1
Host: api-yourfqdn
Authorization: text
x-xdr-auth-id: text
Content-Type: application/json
Accept: */*
Content-Length: 103

{
  "request_data": {
    "query_id": "061880b4867446_4356_inv",
    "pending_flag": true,
    "limit": 100,
    "format": "json"
  }
}
{
  "reply": {
    "status": "PENDING"
  }
}

Get XQL query Quota

post

Retrieve the amount of query quota available and used.

Note: This endpoint only works on XQL queries initiated by /public_api/v1/xql/start_xql_query/.

For more information on how to run XQL queries, see Run XQL Query APIs.

Note

To ensure you don't surpass your quota, Cortex allows you to run up to four API queries in parallel.

Required license: Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

Header parameters
AuthorizationstringRequired

{api_key}

x-xdr-auth-idstringRequired

{api_key_id}

Body
objectOptionalExample: {"request_data":{}}
Responses
200

Successful response

application/json
post/public_api/v1/xql/get_quota
POST /public_api/v1/xql/get_quota HTTP/1.1
Host: api-yourfqdn
Authorization: text
x-xdr-auth-id: text
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "request_data": {}
}
{
  "reply": {
    "license_quota": 5,
    "additional_purchased_quota": 0,
    "used_quota": 0,
    "eval_quota": 0,
    "total_daily_running_queries": 4,
    "total_daily_concurrent_rejected_queries": 8,
    "current_concurrent_active_queries": {
      "debee6b0c41f47_911_inv": {
        "xql": "config timeframe = 1mo | dataset=xdr_data | limit 1000000",
        "duration": 61
      }
    },
    "current_concurrent_active_queries_count": 1,
    "max_daily_concurrent_active_query_count": 4
  }
}

Get XQL query results Stream

post

Retrieve XQL query results with more than 1000 results.

Note: This endpoint only works on XQL queries initiated by /public_api/v1/xql/start_xql_query/.

Response is returned as chunked (Transfer-Encoding: chunked). To retrieve a compressed gzipped response (Content-Encoding: gzip), in your header add Accept-Encoding: gzip.

For more information on how to run XQL queries, see Run XQL Query APIs.

Note

To ensure you don't surpass your quota, Cortex allows you to run up to four API queries in parallel.

Required license: Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

Header parameters
AuthorizationstringRequired

{api_key}

x-xdr-auth-idstringRequired

{api_key_id}

Accept-EncodingstringOptional

For retrieving a compressed gzipped response

Default: gzip
Body
Responses
200

Successful response

application/json
post/public_api/v1/xql/get_query_results_stream
POST /public_api/v1/xql/get_query_results_stream HTTP/1.1
Host: api-yourfqdn
Authorization: text
x-xdr-auth-id: text
Content-Type: application/json
Accept: */*
Content-Length: 84

{
  "request_data": {
    "stream_id": "563c5e24-===-9a1f8139d3c5",
    "is_gzip_compressed": true
  }
}

Last updated

Was this helpful?