Skip to content

Commit

Permalink
Merge pull request #10 from bgpkit/feature-as2org
Browse files Browse the repository at this point in the history
Feature AS inforomation lookup
  • Loading branch information
digizeph authored Jul 18, 2022
2 parents 167fd92 + e8edc59 commit ab2b611
Show file tree
Hide file tree
Showing 9 changed files with 680 additions and 40 deletions.
52 changes: 51 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "monocle"
version = "0.0.3"
version = "0.0.4"
authors = ["Mingwei Zhang <[email protected]>"]
edition = "2021"
readme = "README.md"
license = "MIT"
repository = "https://github.com/bgpkit/monocle"
documentation = "https://docs.rs/monocle"
description = """
A commandline application to search, parse, and process BGP information stored in MRT files.
A commandline application to search, parse, and process BGP information in public sources.
"""
keywords = ["bgp", "bgpkit", "mrt"]

Expand All @@ -31,4 +31,11 @@ chrono = "0.4"
anyhow = "1.0"
tabled = "0.7"
config = {version = "0.13.1", features = ["toml"]}
dirs = "4"
dirs = "4"
rusqlite = { version = "0.28.0", features = ["bundled"] }
reqwest = {version = "0.11", features = ["blocking"]}
flate2 = "1"
regex = "1.6.0"

[features]
scouter = []
73 changes: 62 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

See through all BGP data with a monocle.

![](https://spaces.bgpkit.org/assets/monocle/monocle-200px.jpg)
![](https://spaces.bgpkit.org/assets/monocle/monocle-emoji.png)

*Still in early prototype phase. You are warned.*

Expand All @@ -18,30 +18,36 @@ Subcommands:
- `parse`: parse individual MRT files
- `search`: search for matching messages from all available public MRT files
- `time`: utility to convert time between unix timestamp and RFC3339 string
- `whois`: search AS and organization information by ASN or name

Top-level help menu:
```text
monocle 0.0.1
➜ ~ monocle
monocle 0.0.4
Mingwei Zhang <[email protected]>
A commandline application to search, parse, and process BGP information stored in MRT files.
A commandline application to search, parse, and process BGP information in public sources.
USAGE:
monocle <SUBCOMMAND>
monocle [OPTIONS] <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
-V, --version Print version information
-c, --config <CONFIG> configuration file path, by default $HOME/.monocle.toml is used
--debug Print debug information
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
help Print this message or the help of the given subcommand(s)
parse Parse individual MRT files given a file path, local or remote
scouter Investigative toolbox
search Search BGP messages from all available public MRT files
time Time conversion utilities
help Print this message or the help of the given subcommand(s)
parse Parse individual MRT files given a file path, local or remote
search Search BGP messages from all available public MRT files
time Time conversion utilities
whois ASN and organization lookup utility
```

### `monocle parse`

Parsing single MRT file given a local path or a remote URL.

```text
➜ monocle git:(main) ✗ monocle parse --help
monocle-parse 0.0.1
Expand Down Expand Up @@ -72,6 +78,9 @@ OPTIONS:

### `monocle search`

Search for BGP messages across publicly available BGP route collectors and parse relevant
MRT files in parallel. More filters can be used to search for messages that match your criteria.

```text
➜ monocle git:(main) ✗ monocle search --help
monocle-search 0.0.1
Expand Down Expand Up @@ -101,6 +110,8 @@ OPTIONS:

### `monocle time`

Convert between UNIX timestamp and RFC3339 time strings.

```text
➜ ~ monocle time --help
monocle-time 0.0.3
Expand Down Expand Up @@ -144,6 +155,46 @@ Example runs:
Input time must be either Unix timestamp or time string compliant with RFC3339
```

### `monocle whois`

Search AS/organization-level information with ASN or organization name.

```text
➜ ~ monocle whois --help
monocle-whois 0.0.4
ASN and organization lookup utility
USAGE:
monocle whois [OPTIONS] <QUERY>
ARGS:
<QUERY> Search query, an ASN (e.g. "400644") or a name (e.g. "bgpkit")
OPTIONS:
-a, --asn-only Search by ASN only
-h, --help Print help information
-n, --name-only Search AS and Org name only
-u, --update Refresh local as2org database
-V, --version Print version information
```

Example queries:
```text
➜ ~ monocle whois 400644
+--------+------------+------------+--------------+-------------+----------+
| asn | as_name | org_name | org_id | org_country | org_size |
+--------+------------+------------+--------------+-------------+----------+
| 400644 | BGPKIT-LLC | BGPKIT LLC | BL-1057-ARIN | US | 1 |
+--------+------------+------------+--------------+-------------+----------+
➜ ~ monocle whois bgpkit
+--------+------------+------------+--------------+-------------+----------+
| asn | as_name | org_name | org_id | org_country | org_size |
+--------+------------+------------+--------------+-------------+----------+
| 400644 | BGPKIT-LLC | BGPKIT LLC | BL-1057-ARIN | US | 1 |
+--------+------------+------------+--------------+-------------+----------+
```

## Built with ❤️ by BGPKIT Team

BGPKIT is a small-team focuses on building the best open-source tooling for BGP data processing in Rust. We have over 10 years of
Expand Down
Loading

0 comments on commit ab2b611

Please sign in to comment.