Releases: bgpkit/monocle
V0.0.5 Multi-query whois; Humanized time string
Quick glance
Search ASes and organizations with a single command call:
➜ monocle whois 13335 bgpkit
╭────────┬───────────────┬──────────────────┬──────────────┬─────────────┬──────────╮
│ asn │ as_name │ org_name │ org_id │ org_country │ org_size │
├────────┼───────────────┼──────────────────┼──────────────┼─────────────┼──────────┤
│ 13335 │ CLOUDFLARENET │ Cloudflare, Inc. │ CLOUD14-ARIN │ US │ 5 │
│ 400644 │ BGPKIT-LLC │ BGPKIT LLC │ BL-1057-ARIN │ US │ 1 │
╰────────┴───────────────┴──────────────────┴──────────────┴─────────────┴──────────╯
Show humanized string for time since the queried time:
➜ monocle time 2022-01-01T00:00:00Z
╭────────────┬───────────────────────────┬──────────────╮
│ unix │ rfc3339 │ human │
├────────────┼───────────────────────────┼──────────────┤
│ 1640995200 │ 2022-01-01T00:00:00+00:00 │ 6 months ago │
╰────────────┴───────────────────────────┴──────────────╯
What's Changed
- allow search for multiple entries with
whois
by @digizeph in #18 - Add humanized time difference string by @digizeph in #19
Full Changelog: v0.0.4...v0.0.5
V0.0.4 AS Info Lookup
New Features
monocle whois
This pull request adds a new subcommand monocle whois
that allows querying AS and organization information with ASN or name text.
This function has the following features:
- one bootstrap and offline use forever
- 1 minute bootstrap time
- "smart query": search based on input,
400644
-> search by ASN,bgpkit
-> search by AS name- can always fall back for force searching by ASN or name
- output to table and order entries by organizations' sizes
- SQLite as storage backend, so users can always run queries directly on the database
- The database is stored at
~/.monocle/monocle-data.sqlite3
by default
- The database is stored at
➜ ~ 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:
➜ ~ 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 |
+--------+------------+------------+--------------+-------------+----------+
Monocle Configration
This pull request also adds the initial support for configuring Monocle's behavior. There are two ways to pass configuration values to the function:
- by environment variable with prefix
MONOCLE_
- by changing TOML configuration file at
~/.monocle/monocle.toml
Currently, we have one supported variable:
data_dir
: the directory where the Monocle's SQLite datafile will be stored
Users can configure data_dir
to ~/DATA
in two ways: set environment variable MONOCLE_DATA_DIR=~/DATA
or have a data_dir="~/DATA"
in the ~/.monocle/monocle.toml file like below
### monocle configuration file
### directory for cached data used by monocle
data_dir="~/.monocle"
Pull Requests and Full Changelog
- enable app-level configuration using toml file by @digizeph in #9
- Feature AS inforomation lookup by @digizeph in #10
Full Changelog: v0.0.3...v0.0.4
V0.0.3 Time subcommand
New subcommand monocle time
monocle time
prints out the UNIX timestamp and the corresponding RFC3339 time string. You can provide it a timestamp, a time string, or nothing.
➜ monocle time
+------------+---------------------------+
| unix | rfc3339 |
+------------+---------------------------+
| 1657850362 | 2022-07-15T01:59:22+00:00 |
+------------+---------------------------+
➜ monocle time 0
+------+---------------------------+
| unix | rfc3339 |
+------+---------------------------+
| 0 | 1970-01-01T00:00:00+00:00 |
+------+---------------------------+
➜ monocle time 2022-01-01T00:00:00Z
+------------+---------------------------+
| unix | rfc3339 |
+------------+---------------------------+
| 1640995200 | 2022-01-01T00:00:00+00:00 |
+------------+---------------------------+
➜ monocle time 2022-01-01T00:00:00
Input time must be either Unix timestamp or time string compliant with RFC3339
Enhanced RFC3339 support
It now validates and enforces RFC3339 everywhere when time string is used.
Issues closed
Pull requests and full changelog
Full Changelog: v0.0.2...v0.0.3
V0.0.2 Time string parsing!
RFC3339 EVERYWHERE
You can do queries using rfc3339 time strings now:
monocle search --dry-run --start-ts 2022-01-01T00:00:00 --end-ts 2022-01-01T00:01:00
What's Changed
Full Changelog: v0.0.1...v0.0.2