All Analytics API calls are POST calls.

POST api/v2/analytics/<productId>/<metricstype>

Product ID can have the following values:

Product ID
Description
ladc
Metrics for Lightning ADC applications
thunder
Metrics for Thunder device

Metrics type can have the following values for the product ID ladc:

Metrics Type
Description
app-server
This is associated with data of app-server, including the health index.
flow
This is associated with network flow data of request.
accesslog
This can be used to fetch list of access logs.

For product ID Thunder we can use schema registry API’s to get metric type and schema for metrics and for information refer to, Schema Registry API’s.

Key fields can have the following values:

Object
Value
Description
fields
Any Valid field
Array of field names under the metric type
aggregation
sum, avg, count, min, max, stddev, variance, tophits
Can query different aggregation for fields like sum, mean, avg, max, min.
It can be given in comma separated values.
histogram
Any Valid field - timestamp
on what field the data should be sampled
rangeby
Any Valid field - timestamp
on what field the rangeby filter should be applied
sort
asc,desc
Sort by order of the result, in case of histogram sort will be applied on timestamp.
In other cases sort will be applied on the first field in the fields specified.
groupby
Any valid field
Results are groupedby the specified field
size
integer > 0
size of the returning results
from
integer > 0
pagination page from which the result should be returned
expression
string
Any valid ES complaint expression. Supported operators in Reporting Engine
for expression are addition, subtraction, multiplication and division.
In case of division: add a ‘not-zero’ validation for denominator in the expression.
secondgroupby
Any valid field
Results are groupedby the specified field and after applying first groupby.
scrollId
Valid scroll Id
To query logs by pages, size of each page can be specified by using size.
metricTypes
List of metrics types
To query across multiple metric types, in this case metric type in url need to be empty.
Use URL format POST api/v2/analytics/<productId>.

Using Filter by Reg

Using Aggregation with Filter

Using Aggregation with Filter and Histogram

Using Aggregation with Filter, Group-by

Using Aggregation with Filter, Histogram and Group-by

Querying Logs

Querying Top 10 Information

Log Rate for a Single Provider

POST {

{

"providerId" : "p1",

"lograte" : 100

}

}

GET /analytics/configuration/_provider/lograte

GET https://52.13.103.213/api/v2/analytics/configuration/_provider/lograte

 {

  "b411aef0-6445-11ea-a4c6-3a2ea0e0031f": 100.0,

  "remaining_hc_capacity": 1400.0,

  "default_capacity": 2000.0,

  "capacity": 1500.0

}

DELETE /analytics/configuration/_provider/lograte/{providerId}

Example: Delete

GET /analytics/configuration/_provider/lograte/{providerId}

GET https://52.13.103.213/api/v2/analytics/configuration/_provider/lograte

 {

  "b411aef0-6445-11ea-a4c6-3a2ea0e0031f": 100.0

}

Examples of Expressions

POST api/v2/analytics/thunder-adc/slb_server_port

  {
 "fwd_rev_total_req": {
         "fields":[
         "fastest_rsp_time",
         "slowest_rsp_time"
         ],

   "rangeby": {
     "start": {{START}},
     "end": {{END}},
     "field": "ts"
   },

       "aggregation":"min",
       "expression":"fastest_rsp_time + slowest_rsp_time "
 }
}

Other expression examples are:

  1. Sum: “expression”:”data_cpu_usage.Data2 + data_cpu_usage.Data1 + data_cpu_usage.I/O1”

  2. Division: “expression”: “if (status_1xx! = 0) {status_2xx/status_1xx}”

  3. With constants: “expression”: “tcp_port_used / (nat_ip * varA)”, “params”: {

    ” varA “: 65535,

    }

Examples of Sum/Subtraction/Multiplication

POST api/v2/analytics/thunder-adc/slb_server_port

{
  "fwd_rev_total_req": {
  "fields":[
   "fastest_rsp_time",
   "slowest_rsp_time"
],
  "rangeby": {
   "start": 1584356352000,
   "end": 1584357028000,
   "field": "ts"
 },
  "aggregation":"min",
  "expression":"fastest_rsp_time + slowest_rsp_time "
 }
}

Examples of Division

POST api/v2/analytics/thunder-adc/slb_server_port

 {
   "fwd_rev_total_req": {

   "rangeby": {
    "start": 1592118500000,
    "end": 1592118600000,
    "field": "ts"
  },
    "fields": [
     "conn_smp_free_counter",
     "total_l4_conn_proxy"
  ],
     "aggregation": "max",
     "expression": "if (total_l4_conn_proxy != 0) {conn_smp_free_counter/total_l4_conn_proxy}"

 }
}

Examples With Constants

POST api/v2/analytics/thunder-adc/slb_server_port

{
  "fwd_rev_total_req": {
  "fields":[
   "fastest_rsp_time",
   "slowest_rsp_time"
],
 "rangeby": {
   "start": 1584356352000,
   "end": 1584357028000,
   "field": "ts"
 },
  "aggregation":"min",
  "expression":"fastest_rsp_time + slowest_rsp_time + varA ",
  "variables": {
  "varA" : 2
  }
 }
}

Two Groupby’s

POST api/v2/analytics/thunder-adc/system_telemetry_log_device_status

{
  "metrics": {
  "rangeby": {
    "start": 1585538788000,
    "end": 1586456642000,
    "field": "ts"
 },
  "fields": [
         "avg_control_cpu_usage"
 ],
 "aggregation":"sum",

 "groupby":"cpu_usage_overall.Data1",
 "secondgroupby":"device_uuid",

 "filterby": {
   "and": {
     "cluster_id": "C3C66AA627BEC377E1E78373523B9F72730AFC39"
   }
  }
 }
}

Multiple Metric or Log Types

POST api/v2/analytics/thunder

{
  "metrics": {
  "rangeby": {
    "start": 1587536788000,
    "end": 1587721067000,
    "field": "ts"
 },
 "metricTypes":["cgn_l4_pc", "fw_l4_pc"],
 "size":100,
 "type":"logs"
 }
}

Pagination for Querying Logs

POST api/v2/analytics/thunder/accesslog

{
      "logs": {
   "rangeby": {
      "start": 1568629640000,
      "end": 1568712445000,
      "field": "timestamp"
     },
     "size": 1000,
     "scrollTimeout": "10",
     "scrollId": "0"
    }
}

Query Unique Number of Source or Destination IP Address Timeseries

{

  "responseTime": {
   "fields": [
     "src_ip_addr"
    ],
    "aggregation": "distinctcount",
    "rangeby": {
      "start": 1531740077768,
      "end": 1531740257768,
      "field": "ts"
     },
    "filterby": {
      "and": {
       "app_svc_id": "6944e46e-8684-11e8-85fd-000c29f6bd62"
      }
    }
  }
}

Schema Registry API’s

Using schema registry API’s user can get what metric types are registered or collected, inspect each of the metric types to see what fields exist.

Registered Schemas

GET api/v2/schema-registry/subjects

Example output:

[
 "slb_virtual_server_port",
 "slb_ssl_forward_proxy",
 "slb_template_cache",
 "fw_alg_tftp",
 "rule_set_application",
 "slb_http_proxy",
 "system_telemetry_log_top_k_app_svc_list",
 "fw_global",
 "slb_server",
 "rule_set",
 "slb_server_port",
 "system_telemetry_log_partition_metrics",
 "aam_authentication_server_windows",
 "cgnv6_nat64_global",
 "slb_service_group",
 "linkprobes",
 "fw_alg_pptp",
 "vpn_error",
 "vpn_ike_stats_global",
 "ip_nat_pool",
 "slb_vport_l7_http_pr",
 "waf_vport_l7_http_pr",
 "aam_authentication_saml_global",
 "fw_tcp_window_check"
]

List Versions of Schema by Schema Name

GET /api/v2/schema-registry/subjects/<schema_name>/vesions

Example:

GET /api/v2/schema-registry/subjects/ cgn_l4_pc/versions

Output:

[
   1,
   2
]

Get Schema by Name and Version

GET api/v2/schema-registry/subjects/<schema_name>/versions/<virsion_id>

Example

GET api/v2/schema-registry/subjects/ cgn_l4_pc/versions/1

Output:

{
  "subject": "cgn_l4_pc",
  "version": 1,
  "id": 12,
  "schema": "{\"type\":\"record\",\"name\":\"cgn_l4_pc\",\"fields\":[{\"name\":\"ts\",\"type\":\"long\"},{\"name\":\"account_id\",\"type\":\"string\"},{\"name\":\"device_uuid\",\"type\":\"string\"},{\"name\":\"o_uuid\",\"type\":\"string\"},{\"name\":\"p_id\",\"type\":\"int\"},{\"name\":\"cluster_id\",\"type\":\"string\"},{\"name\":\"app_svc_type\",\"type\":\"string\"},{\"name\":\"app_svc_id\",\"type\":\"string\"},{\"name\":\"technology\",\"type\":\"string\"},{\"name\":\"proto\",\"type\":\"string\"},{\"name\":\"ipv6_fwd_src\",\"type\":\"string\"},{\"name\":\"ipv4_fwd_src\",\"type\":\"string\"},{\"name\":\"ipv6_fwd_dst\",\"type\":\"string\"},{\"name\":\"ipv4_fwd_dst\",\"type\":\"string\"},{\"name\":\"fwd_srcport\",\"type\":\"int\"},{\"name\":\"fwd_dstport\",\"type\":\"int\"},{\"name\":\"ipv6_rev_src\",\"type\":\"string\"},{\"name\":\"ipv4_rev_src\",\"type\":\"string\"},{\"name\":\"ipv6_rev_dst\",\"type\":\"string\"},{\"name\":\"ipv4_rev_dst\",\"type\":\"string\"},{\"name\":\"rev_srcport\",\"type\":\"int\"},{\"name\":\"rev_dstport\",\"type\":\"int\"},{\"name\":\"lsn_lid\",\"type\":\"int\"},{\"name\":\"pool_name\",\"type\":\"string\"},{\"name\":\"msisdn\",\"type\":\"string\"},{\"name\":\"imei\",\"type\":\"string\"},{\"name\":\"imsi\",\"type\":\"string\"},{\"name\":\"custom1_name\",\"type\":\"string\"},{\"name\":\"custom1_val\",\"type\":\"string\"},{\"name\":\"custom2_name\",\"type\":\"string\"},{\"name\":\"custom2_val\",\"type\":\"string\"},{\"name\":\"custom3_name\",\"type\":\"string\"},{\"name\":\"custom3_val\",\"type\":\"string\"},{\"name\":\"action\",\"type\":\"string\"},{\"name\":\"icmp_type\",\"type\":\"int\"},{\"name\":\"icmp_code\",\"type\":\"int\"},{\"name\":\"call_id\",\"type\":\"int\"},{\"name\":\"src_zone\",\"type\":\"string\"},{\"name\":\"dst_zone\",\"type\":\"string\"},{\"name\":\"in_intf\",\"type\":\"string\"},{\"name\":\"out_intf\",\"type\":\"string\"},{\"name\":\"app_protocol\",\"type\":\"string\"},{\"name\":\"app_category\",\"type\":\"string\"},{\"name\":\"rule_set\",\"type\":\"string\"},{\"name\":\"rule\",\"type\":\"string\"},{\"name\":\"duration\",\"type\":\"long\"},{\"name\":\"log_reason\",\"type\":\"string\"},{\"name\":\"session_status\",\"type\":\"string\"},{\"name\":\"fwd_packets\",\"type\":\"int\"},{\"name\":\"fwd_bytes\",\"type\":\"long\"},{\"name\":\"rev_packets\",\"type\":\"int\"},{\"name\":\"rev_bytes\",\"type\":\"long\"},{\"name\":\"fwd_small_packet\",\"type\":\"int\"},{\"name\":\"rev_small_packet\",\"type\":\"int\"},{\"name\":\"fwd_frag\",\"type\":\"int\"},{\"name\":\"rev_frag\",\"type\":\"int\"},{\"name\":\"fwd_syn\",\"type\":\"int\"},{\"name\":\"rev_syn\",\"type\":\"int\"},{\"name\":\"fwd_fin\",\"type\":\"int\"},{\"name\":\"rev_fin\",\"type\":\"int\"},{\"name\":\"fwd_rst\",\"type\":\"int\"},{\"name\":\"rev_rst\",\"type\":\"int\"},{\"name\":\"fwd_zero_wnd\",\"type\":\"int\"},{\"name\":\"rev_zero_wnd\",\"type\":\"int\"},{\"name\":\"fwd_pure_ack\",\"type\":\"int\"},{\"name\":\"rev_pure_ack\",\"type\":\"int\"},{\"name\":\"fwd_rexmit\",\"type\":\"int\"},{\"name\":\"rev_rexmit\",\"type\":\"int\"},{\"name\":\"direction\",\"type\":\"string\"}]}"
}

CGN Use Cases

Concurrent Users

POST api/v2/analytics/thunder-adc/cgnv6_fixed_nat_global

 {
  "A10.CGN.FixedNAT_CONNECTION_USERS_AVG": {
  "rangeby": {
    "start": 1590477960000,
    "end": 1590478140000,
    "field": "ts"
  },
  "fields": [
    "active_subscriber_added",
    "active_subscriber_removed"
  ],
  "aggregation": "avg",
  "expression": "active_subscriber_added-active_subscriber_removed",
  "filterby": {
    "and": {
      "app_svc_id": "e1f17b02-a493-11e8-ad3b-67471708866d"
    }
   }
 }
}

Number of Sessions

POST api/v2/analytics/thunder-adc/cgnv6_fixed_nat_global

{
 "A10.CGN.FixedNAT_NUM_SESSIONS_AVG": {
 "rangeby": {
   "start": 1590477960000,
   "end": 1590478140000,
   "field": "ts"
 },
 "fields": [
   "nat44_data_session_created",
   "nat64_data_session_created",
   "dslite_data_session_created",
   "nat44_data_session_freed",
   "nat64_data_session_freed",
   "dslite_data_session_freed"
 ],
 "aggregation": "avg",
 "filterby": {
   "and": {
     "app_svc_id": "e1f17b02-a493-11e8-ad3b-67471708866d"
   }
  }
 }
}