Data Explorer Query API now compatible with Filter-Based Dimensions
One of Data Explorer's most advanced and clever features allows users to generate a set of time series, each based on a different set of filters: Filter-Based Dimensions.
Up until now, the Actions > Show API Call menu option would produce a query that wouldn't return the resulting time series but only the total metric value.
We have now backported this feature into our Query API for you to use.
What is a filter-based dimension?
Regular data explorer dimensions will only let you "break down" metrics by dimensions (think of it as a "Group By" on dimensions in the SQL world). Filter-based Dimensions were added to Data Explorer so users could consider slices of traffic that may overlap (and therefore where a "Group By" will not do the job), but that you'd still want to compare to each other within the same chart. With Filter-Based Dimensions, users can define as many time series as they want to be displayed, each one with its own independent filter, regardless to any potential overlap of the traffic slices for each filter.
A good example use for these is displaying subscriber traffic coming from different farms of servers without using a Custom Dimension to discriminate traffic from each farm - let's dive into an example.
- traffic from Farm-1
- comes inbound from devices with the
compute
label- on these two routers, it leverages interfaces with a description string containing
farm-1
- traffic from Farm-2
- comes inbound from
Router-2
- is sourced within the
1.2.3.0/24
CIDRYou can define two Filter-based Dimensions to identify traffic from these farms by creating two filters, one for each series which will be displayed in the chart
How can I get the API Call for a Data Explorer Filter-based Dimension query?
All you need to do is create your Data Explorer Filter-based Dimension query and proceed to Actions > Show API Call and a cURL query will be generated for you to use displaying the literal query to use in your code.
If we go back to our initial example, you'll notice that your Filter-based Dimensions are now fully described in the generated API call.
"filterDimensions": { "connector": "All", "filterGroups": [ { "name": "Farm 1", "named": true, "connector": "All", "not": false, "autoAdded": "", "filters": [ { "filterField": "i_device_label", "metric": "", "aggregate": "", "operator": "=", "filterValue": "21" }, { "filterField": "i_input_snmp_alias", "metric": "", "aggregate": "", "operator": "ILIKE", "filterValue": "farm-1" } ], "saved_filters": [], "filterGroups": [] }, { "name": "Farm 2", "named": true, "connector": "All", "not": false, "autoAdded": "", "filters": [ { "filterField": "i_device_name", "metric": "", "aggregate": "", "operator": "ILIKE", "filterValue": "Router-2" }, { "filterField": "inet_src_addr", "metric": "", "aggregate": "", "operator": "ILIKE", "filterValue": "1.2.3.0/24" } ], "saved_filters": [], "filterGroups": [] }