Summarize a network
summarize_networkGroup MMDB records in a CIDR by a scalar field, apply field filters, and count records and covered addresses for country or ASN summaries.
Instructions
Group matching records by a scalar field, such as country.iso_code or autonomous_system_number. Count records and covered addresses within a CIDR. Use lookup_network to retrieve individual records. IPv4 aliases are excluded. Exceeding 10,000 scanned records or 100 groups returns an error. Use a smaller CIDR if a limit is reached.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Conditions on record fields. For example, [{"field":"autonomous_system_number","operator":"equals","value":13335}]. Omit for no filtering on a new query. On paginated queries, omit to retain the original filters. | |
| network | Yes | CIDR to summarize. Use an IPv4 prefix length of 8 or greater, or a native IPv6 prefix length of 32 or greater. | |
| database | Yes | Exact filename of a loaded database from list_databases. | |
| group_by | Yes | Path to a scalar field, for example country.iso_code or autonomous_system_number. Use inspect_database to find paths. Supports numeric array indexes and $ for a scalar record. Missing fields form a separate group. | |
| filter_mode | No | Combine filters with and (all must match) or or (any can match). Defaults to and for a new query. Omit when paging to retain the original mode. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | Yes | ||
| network | Yes | ||
| database | Yes | ||
| group_by | Yes | ||
| matched_records | Yes | ||
| scanned_records | Yes | ||
| total_addresses | Yes | ||
| matched_addresses | Yes |