Monitoring your infrastructure resources is every organization's need. Every server, backend, Kubernetes resource, and application generates tons of logs every day. Axiom CLI helps you store and query insights from the data collected from various data sources on Axiom. Running queries with Axiom CLI helps you find errors and issues in your application.
Axiom CLI querying provides a centralized CLI for interactive diagnostic logs search for your applications, Kubernetes workloads, CloudStack, and backend. Using Axiom CLI, you can explore and analyze your logs by running queries that make it easy to understand and visualize your logs instantly.
- Sign up on Axiom Cloud and create an account
- Axiom CLI installed on your machine
- Homebrew, Go, or Docker installed on your machine.
Install and download Axiom CLI on your local machine.
Next, create a new dataset, go to Settings → Datasets on the Axiom UI.
- You can also create your dataset on the Axiom CLI by typing
axiom dataset createon your terminal and entering the name of your dataset.
Generate your ingest token. Visit our docs to learn how you can generate ingest tokens.
Validate the installation of Axiom CLI by typing
axiom-vin your terminal.
- Login to your Axiom Deployment using
axiom auth login
- Choose the kind of Deployment you want to use and enter your deployment URL.
- Enter your ingest or personal token.
- When you are done, you will get the check mark that you've been logged in.
- Next, ingest your data logs into Axiom. You can use any of our data-shippers to ingest logs or use our CLI. To ingest logs using the
axiom ingest --helpin your terminal.
- Remember that your dataset name will be the name of the dataset you created in step 1. In the image below, the dataset name is
- Next, use the query command
axiom query <dataset_name>to query your logs using APL.
- The name of my dataset I created in step 1 is
http-logsso if I want to query it using Axiom CLI it will be
axiom query "['http-logs']"If you have a dataset that has special characters like
-you would have to include the quoted marks like this
- Get the history of all your logs in your dataset.
- Query using APL directly on your terminal.
You can see the output of the logs below:
- Run more Queries in your CLI using APL
- Output of the Query:
- There are other commands you can run on the Axiom CLI like:
Live stream your data using
axiom stream <dataset_name>
Select an Axiom deployment using
axiom auth select
- Get info about a dataset using
axiom dataset info
- Select your dataset you want to get
There is a lot that Axiom CLI can do to help you be more productive when creating, managing, and building your Axiom Projects. A good place to look for more tips is in the help provided by the CLI itself. I’d recommend digging around:
# Overview of commands available axiom help # More specific help for a given command axiom help [command]
You can also explore the code repository for the Axiom CLI on GitHub.
References for the road
Explore Axiom Processing Language
Read more contents from our blog
Click this link to join other developers in the Axiom community who are using Axiom. Find resources, ask questions, and share your knowledge!
Sign up for Axiom Cloud - The fastest and simplest way to get started with Axiom.