ris-live-rs
Provides parsing functions for RIS-Live real-time BGP message stream JSON data.
The main parsing function, parse_ris_live_message
converts a JSON-formatted message string into a
vector of BgpElem
s.
Example
use json;
use ;
use Url;
use ParserRisliveError;
use parse_ris_live_message;
const RIS_LIVE_URL: &str = "ws://ris-live.ripe.net/v1/ws/?client=rust-bgpkit-parser";
/// This is an example of subscribing to RIS-Live's streaming data.
///
/// For more RIS-Live details, check out their documentation at https://ris-live.ripe.net/manual/
Filtering
ris-live-rs
support filtering message by composing customized
ris-live subscription message. Use the compose_subscription_message
function to create a filtering message.
// subscribe to messages from one collector
let msg = compose_subscription_message;
println!;
socket.write_message.unwrap;
ris-live-reader
ris-live-rs
library also comes with a simple command-line program
that supports filtering and different output formats: ris-live-reader
.
Full command-line options are:
ris-live-rs 0.1.0
Mingwei Zhang <mingwei@bgpkit.com>
ris-live-reader is a simple cli tool that can stream BGP data from RIS-Live project with websocket
USAGE:
ris-live-reader [OPTIONS]
OPTIONS:
--client <CLIENT> client name to identify the stream [default: ris-live-rs]
-h, --help Print help information
--host <HOST> Filter by RRC host: e.g. rrc01
--json Output as JSON objects
--less-specific Match prefixes that are less specific (contain) `prefix`
--more-specific Match prefixes that are more specific (part of) `prefix`
--msg-type <MSG_TYPE> Only include messages of a given BGP or RIS type: UPDATE, OPEN,
NOTIFICATION, KEEPALIVE, or RIS_PEER_STATE
--path <PATH> ASN or pattern to match against the AS PATH attribute
--peer <PEER> Only include messages sent by the given BGP peer
--prefix <PREFIX> Filter UPDATE messages by prefixes in announcements or withdrawals
--pretty Pretty-print JSON output
--raw Print out raw message without parsing
--require <REQUIRE> Only include messages containing a given key
-V, --version Print version information
Installation
Install via cargo by:
Or checkout the repo and run:
The program ris-live-reader
will be installed to your $CARGO_HOME/bin
(e.g. ~/.cargo/bin
).
Run with Docker
Minimum Supported Rust Version (MSRV)
1.46.0
Built with ❤️ by BGPKIT Team
BGPKIT is a small-team start-up that focuses on building the best tooling for BGP data in Rust. We have 10 years of experience working with BGP data and believe that our work can enable more companies to start keeping tracks of BGP data on their own turf. Learn more about what services we provide at https://bgpkit.com.