forked from mirrors/thatmattlove-hyperglass
74 lines
3.3 KiB
Text
74 lines
3.3 KiB
Text
---
|
|
id: table-output
|
|
title: Table Output
|
|
sidebar_label: Table Output
|
|
description: Configure structured data parameters
|
|
---
|
|
|
|
Devices that support responding to a query with structured or easily parsable data can have their response data placed into an easier to read table (or JSON, when using the [REST API](rest-api)). Currently, the following platforms have structured data supported in hyperglass:
|
|
|
|
- Juniper Junos
|
|
- Arista EOS
|
|
|
|
:::note
|
|
Unlike with standard text output, devices with structured data enabled do not support customization of their commands. This is because the response must be something hyperglass is preconfigured to understand and parse, so hyperglass must maintain control over the specific command to run for a given platform.
|
|
:::
|
|
|
|
<div class="table--full-width" />
|
|
|
|
The `structured` subsection contains multiple subsections of its own:
|
|
|
|
| Section | Description | All Options |
|
|
| :------------ | :--------------------------------- | :---------------------------------------: |
|
|
| `communities` | Include or exclude BGP communities | <PageLink to="#communities">➡️</PageLink> |
|
|
| `rpki` | Configure RPKI validation | <PageLink to="#rpki">➡️</PageLink> |
|
|
|
|
## `communities`
|
|
|
|
| Parameter | Type | Default | Description |
|
|
| :-------- | :----: | :------: | :------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `mode` | String | `'deny'` | `'deny'` denies any matching patterns and permits anything else. `'permit'` only permits matching patterns and denies everything else |
|
|
| `items` | List | `[]` | List of regular expression patterns to match |
|
|
|
|
:::note Regular Expressions with YAML
|
|
If you're using any regex patterns with special characters, you'll probably need to wrap the patterns in single quotes, to denote a raw string. For example:
|
|
|
|
```yaml
|
|
normal_string: Normal String
|
|
raw_string: '^Raw\sString$'
|
|
```
|
|
|
|
:::
|
|
|
|
## `rpki`
|
|
|
|
| Parameter | Type | Default |
|
|
| :-------- | :----: | :--------: |
|
|
| `mode` | String | `'router'` |
|
|
|
|
### `router` mode
|
|
|
|
`router` mode uses the RPKI state from the perspective of the router. This means if your network is not using Origin Validation, the RPKI state will be shown as "Not Verified". Otherwise, the corresponding RPKI state will be shown.
|
|
|
|
### `external` mode
|
|
|
|
`external` mode takes each prefix, the last ASN in the `AS_PATH` and requests the RPKI validation state via the [Cloudflare RPKI Portal](https://rpki.cloudflare.com/).
|
|
|
|
## Example
|
|
|
|
```yaml title="hyperglass.yaml"
|
|
structured:
|
|
communities:
|
|
mode: permit
|
|
items:
|
|
- '65000:\d+'
|
|
- '65[1-4]00:\d+'
|
|
rpki:
|
|
mode: external
|
|
```
|
|
|
|
## Caveats
|
|
|
|
### Arista EOS
|
|
|
|
For whatever reason, Arista EOS does not supply certain details about routes in its JSON output when running commands `show ip bgp regex <pattern>` or `show ip bgp community <community>`. Specifically, the the route's timestamp and any attached communities are not supplied. When these commands are used with Arista EOS, hyperglass sets the timestamp to the current time, and the community to an empty list.
|