March 18, 2021

#engineering

Introducing the Axiom CLI


Blog Screenshot
Author
Tola Ore-Aruwaji

Developer Relations Engineer

We’re excited to announce the release of Axiom CLI, and we want to highlight some of its awesome features in this post!

The Axiom team have been working really hard on the first version of the Axiom CLI, a powerful way to use Axiom directly from the comfort of your terminal.

Here are some of the CLI’s key features:

  • Easily ingest data in multiple formats from your local machine into your Axiom instance

  • Stream data live, allowing you to monitor your services without leaving the comfort of your terminal

  • Work with different Axiom deployments, easily switching between them

  • Easy to install, simple to get started with

  • Cross-platform; works on Linux, macOS, and Windows

  • Open Source; we’d love your contributions and ideas

Let’s dive into some of our favourite features:

Ingest Data

Using the Axiom CLI you can ingest the contents of a JSON logfile into any dataset name. The structured data follows the JSON specification for which field types are supported, an event could look like this:

{
  "service": "api-http",
  "severity": "error",
  "duration": 231,
  "customer_id": "ghj34g32poiu4",
  "tags": ["aws-east-1", "zone-b"],
  "metadata": {
    "version": "3.1.2"
  }
}

Before ingesting data, create the dataset using your Ingest API Token or personal token, this can be generated from the settings → tokens page in Axiom. Once you have generated the Token, you can format and upload your dataset in any of the supported input formats: JSON, NDJSON, and CSV.

# Ingest the contents of a JSON file
# into a dataset named "json-logs":
$ axiom ingest json-logs -f json-logs.json

# ingest the contents of a CSV file
# into a dataset named "csv-logs":
$ axiom ingest csv-logs -f csv-logs.csv

# ingest the contents of a NDJSON file
# into a dataset named "ndjson-logs":
$ axiom ingest ndjson-logs -f ndjson-logs.ndjson

Stream Data

Axiom CLI makes it very easy to view your data as it’s being ingested live. This allows you to inspect individual events and watch as they are logged, just like you were running your service locally.

# ingest logs in the CSV, JSON, or NDJSON format
$ axiom ingest tola-datasets -f test-cli.json

# stream ingested logs on cli
$  axiom stream tola-datasets

Manage Datasets

You can quickly and easily view and manage datasets inside your Axiom deployment via Axiom CLI:

Try Axiom CLI now

You can try Axiom CLI right now if you have an Axiom deployment. Check out our GitHub repo to get started, and check out our additional documentation too.

If you run into any issues or have feedback, feel free to reach out via our Discord community or email support@axiom.co.

For more information on Axiom CLI visit our links:

Happy hacking – we can’t wait to see what you do with it!

Share
Get started with Axiom

Learn how to start ingesting, streaming, and
querying data into Axiom in less than 10 minutes.