Giter VIP home page Giter VIP logo

logiqctl's Introduction

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 [email protected]: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 [[email protected]]. You can also log an issue in our logiqctl source code repository on GitHub.

logiqctl's People

Contributors

rparth avatar pepejuang avatar sriram-logiq avatar sriram5597 avatar titogeorge avatar abhikhnvasara avatar ajit-logiq avatar pepisito avatar kevin-logiq avatar ohmanandam avatar sokryptk avatar

Stargazers

 avatar Youssef avatar Fabio Kubo avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

logiqctl's Issues

Error improvement - please verify and enhance if needed.

Context: We were on a client demo environment and ran the below commands; command three below threw, and the error said invalid JSON error; essentially, logical was unable to connect to the cluster, which was the root cause. Once we joined (set-cluster) to the public endpoint, the create dashboard worked perfectly.

Improvements must be made to display proper error messages when there are connectivity issues.

  1. ./logiqctl_linux_amd64 config set-cluster xyz.com
  2. ./logiqctl_linux_amd64 config set-credential
  3. ./logiqctl_linux_amd64 create dashboard -f dash.json

Change messages

Change Atleast 0 records remaining message to somthing else.

Change Enter nornext' to continue.tologiqctl n`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.