logiqctl

command module
v0.0.0-...-28787c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

logiqctl

logiqctl is LOGIQ's inbuilt command-line toolkit that lets you interact with the LOGIQ Observability platform without logging into the UI. Using logiqctl, you can:

  • Stream logs in real-time
  • Query historical application logs
  • Search within logs across namespaces
  • Query and view events across your LOGIQ stack
  • View and create event rules
  • Create and manage dashboards
  • Query and view all your resources on LOGIQ such as applications, dashboards, namespaces, processes, and queries
  • Manage LOGIQ licenses

Quickstart

The quickest way to start using logiqctl is to download a pre-built binary from our release page on GitHub.

Configuring logiqctl

Once you've downloaded the binary, you can configure logiqctl to interact with your LOGIQ instance by doing the following:

  1. Set your cluster URL:
    logiqctl config set-cluster <CLUSTER_URL>
    
  2. Set the API token:
    logiqctl config set-token <LOGIQ_API_KEY>
    
    Note: If you don't have a LOGIQ API key, read Obtaining API Key to learn how to obtain one.
  3. Set your LOGIQ credentials:
    logiqctl config set-ui-credential flash-userid password
    
  4. Set your default namespace:
    logiqctl config set-context NAMESPACE
    
  5. Verify your logiqctl configuration:
    logiqctl get namespaces
    

This completes the installation of logiqctl. You can now use logiqctl to interact with your LOGIQ instance right from your terminal.

Pattern-signature generation

Logiqctl is equipped with log Pattern-Signature (PS) generation and post PS statistics analysis. All the logs dumped by logiqctl client can be automatically calcaulated common text patterns using the flag (-g). This feature supports log dumping functions 'logiqctl logs', 'logiqctl logs search', and 'logiqctl tail'.

PS generation is processed in binary psmod executable.

  • running with ps gen requires psmod be at the same location as logiqctl.
  • From the downloaded releases zip file, copy both the psmod and logiqctl binaries for your architecture/os before running e.g. if your architecture is darwin_amd64, copy logiqctl_darwin_amd64 and psmod_darwin_amd64 to a folder. Rename psmod_darwin_amd64 to psmod before running logiqctl
  • Once pattern signatures are generated, see the signatures extracted in the ps_stat.out file.

Building logiqctl from source

Another way of installing logiqctl is by building it from the source code. Building logiqctl from its source code involves two steps:

  • Installing dependencies
  • Downloading and building the logiqctl binary

Installing dependencies

logiqctl has the following dependencies:

  • Go: You can install Go by following the instructions listed on [https://golang.org/dl/]
  • Protocol Buffers: Download the binary and set it up by running the following commands:

On macOS:

PROTOC_ZIP=protoc-3.15.6-osx-x86_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP

On Linux OS:

PROTOC_ZIP=protoc-3.15.6-linux-x86_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP

This completes the installation of all logiqctl dependencies.

Building logiqctl

Run the following commands to build logiqctl from the source code:

  1. Create a directory inside your workspace in which to keep source code:
    mkdir -p $GOPATH/src/github.com/logiqai
    
  2. Accesss the source code directory:
    cd $GOPATH/src/github.com/logiqai
    
  3. Clone the logiqctl GitHub repository into this folder:
    git clone git@github.com:logiqai/logiqctl.git
    
  4. Access the repository you just cloned:
    cd logiqctl
    
  5. Build logiqctl:
    go build logiqctl.go
    
  6. Make the binary logiqctl executable:
    chmod +x ./logiqctl
    
  7. Verify the build:
    logiqctl -h
    

logiqctl is now built and ready for configuration and use. To configure logiqctl, refer to the configuration instructions listed under Configuring logiqctl.

Available logiqctl commands

Command Operation
logiqctl config Configure logiqctl or modify existing logiqctl configuration
logiqctl tail Stream logs from your LOGIQ instance in real-time
logiqctl create Create LOGIQ resources such as dashboards and event rules
logiqctl get Display one or more LOGIQ resources
logiqctl license View and manage your LOGIQ license
logiqctl logs View logs for the given namespace and application

Options

  -c, --cluster string       Override the default cluster set by `logiqctl set-cluster' command
  -h, --help                 help for logiqctl
  -n, --namespace string     Override the default context set by `logiqctl set-context' command
  -o, --output string        Output format. One of: table|json|yaml. 
                             json output is not indented, use '| jq' for advanced json operations (default "table")
  -t, --time-format string   Time formatting options. One of: relative|epoch|RFC3339. 
                             This is only applicable when the output format is table. json and yaml outputs will have time in epoch seconds. (default "relative")
Release Note:
Thu Jul  8 15:04:59 PDT 2021 (2.1.0)
  - Enhance search operation with time-ranges
  - PS enhancement using addon binary module psmod
Mon Jul  5 21:24:25 PDT 2021
  - Enhance with log pattern-signature (PS) generation support
Wed Jul 14 17:13:48 PDT 2021 (2.1.1)
  - Multiple application searches
Thu Jul 15 09:02:23 PDT 2021 (2.1.2)
  - Inconsistent multi-apps display fixes
Tue Aug  3 07:54:39 PDT 2021
  - Enhance search capability
Wed Sep 15 14:10:46 PDT 2021
  - Enable advanced search feature
Fri Nov  5 16:05:50 PDT 2021
  - Fixed dashboard text import/export, add http network trace

To know more about the LOGIQ Observability stack, see https://logiq.ai/ and https://docs.logiq.ai/.

In case of issues or questions, do reach out to us at [cli@logiq.ai]. You can also log an issue in our logiqctl source code repository on GitHub.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1/applications
Package applications is a reverse proxy.
Package applications is a reverse proxy.
v1/eventRules
Package eventRules is a reverse proxy.
Package eventRules is a reverse proxy.
v1/events
Package events is a reverse proxy.
Package events is a reverse proxy.
v1/federation
Package federation is a reverse proxy.
Package federation is a reverse proxy.
v1/license
Package license is a reverse proxy.
Package license is a reverse proxy.
v1/namespace
Package namespace is a reverse proxy.
Package namespace is a reverse proxy.
v1/processes
Package processes is a reverse proxy.
Package processes is a reverse proxy.
v1/query
Package query is a reverse proxy.
Package query is a reverse proxy.
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL