• This repository has been archived on 25/Jul/2018
  • Stars
    star
    326
  • Rank 128,276 (Top 3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A terminal-only version of Sumo written in Go

Archived!

We have chosen to archive sumoshell as we can not continue to support its growth. The original author has created a spiritual successor called angle-grinder and we recommend you investigate that.

sumoshell

Join the chat at https://gitter.im/SumoLogic/sumoshell

Sumoshell is collection of utilities to improve analyzing log files written in Go. grep can't tell that some log lines span multiple individual lines. Parsing out fields is cumbersome. Aggregating is basically impossible, and there is no good way to view the results. In Sumoshell, each individual command acts as a phase in a pipeline to get the answer you want. Sumoshell brings a lot of the functionality of Sumo Logic to the command line.

Commands should start with sumo search [filter] which will transform logs into the json format sumoshell uses. Commands should end with render or graph which render the output to the terminal. Each operator is a stand-alone binary allowing them to be easily composed.

Installation

OSX and Linux binaries are provided for sumoshell. Simply extract the archive and place the binaries on your path.

If you run a different OS or would prefer to install from source, it's easy to build from source. Given a working go installation, run:

go get github.com/SumoLogic/sumoshell
cd $GOPATH/src/github.com/SumoLogic/sumoshell # Will warn about `no buildable go source`
go get ./...
go install ./...

Usage

Like SumoLogic, sumoshell enables you pass log data through a series of transformations to get your final result. Pipelines start with a source (tail, cat, etc.) followed by the sumo operator. An example pipeline might be:

tail -f logfile | sumo search "ERROR" | sumo parse "thread=*]" | sumo count thread | render

This would produce a count of log messages matching ERROR by thead. In the basic renderer, the output would look like:

_Id   _count   thread   
0     4        C        
1     4        A        
2     1        B      

The sumo search operator

sumo search takes an optional filter parameter to allow for basic searching. The sumo operator performs 3 steps:

  1. Break a text file into logical log messages. This merges things like stack traces into a single message for easy searching.
  2. Allow basic searching.
  3. Transforms the log message into the sumoshell internal json format.

The sumo json operator

For JSON logging, the sumo json operator will automatically parse JSON from your logs and extract key value pairs.

Displaying results

After using the sumo operator, the output will be in JSON. To re-render the output in a human-readable form, | the results of your query into one of the three render operators.

  1. render: Capable of rendering aggregate and non-aggregate data.
  • Add nowraw to drop the raw data when an aggregate isn't present.
  • Aggregates are updated in place using terminal escape sequences, with a limit of 20 shown. Add all to remove the limit. Aggregates will be rendered when the stream ends (ctrl+c)
  1. graph: Curses based renderer for rendering tabular data as a bar chart.

Parsing Data

sumoshell supports a basic parse operator similar to the parse operator in SumoLogic. Queries take the form:

... | sumo parse "[pattern=*] pattern2:'*' morePatterns=(*)" as pattern, pattern2, more | ...

Filtering Data

sumoshell supports a filter operator similar to the where operator in SumoLogic. Queries take the form:

... | sumo parse "[host=*]" as host | sumo filter host = server1 

This will drop any log lines that don't have server1 as the host.

Aggregating Data

sumoshell currently supports 3 aggregate operators:

  1. count Example queries:
... | sumo count           # number of rows
... | sumo count key       # number of rows per key
... | sumo count key value # number of rows per the cartesian product of (key, value)

  1. sum Example queries:
... | sumo sum k      # sum of all k's
... | sumo sum v by k # sum of all v's by k

  1. average Example queries:
... | sumo average k      # average of all k's
... | sumo average v by k # average of all v's by k

More Repositories

1

sumologic-aws-lambda

A collection of lambda functions to collect data from Cloudwatch, Kinesis, VPC Flow logs, S3, security-hub and AWS Inspector
Python
151
star
2

sumologic-kubernetes-collection

Sumo Logic collection solution for Kubernetes
Go
146
star
3

sumologic-content

Welcome to Sumo Logic's Community Content Repository!
Python
107
star
4

sumologic-python-sdk

Python
84
star
5

livetail-cli

Download the Sumo Logic Live Tail CLI tool.
Python
73
star
6

sumologic-collector-docker

A Sumo Logic collector for Docker.
Shell
69
star
7

fluentd-kubernetes-sumologic

FluentD plugin to extract logs from Kubernetes clusters, enrich and ship to Sumo logic.
Ruby
61
star
8

elasticsearch-client

Elasticsearch Client for Scala that operates against the REST Endpoint
Scala
57
star
9

sumologic-docker-logging-driver

A Docker logging driver plugin to send logs to Sumo Logic.
Go
53
star
10

tailing-sidecar

tailing sidecar - the cluster-level logging agent for Kubernetes
Go
47
star
11

js-sumo-logger

Sumo Logic JavaScript SDK for Logging
JavaScript
45
star
12

sumologic-otel-collector

Sumo Logic Distribution for OpenTelemetry Collector
Go
39
star
13

terraform-provider-sumologic

Terraform provider for Sumo Logic
Go
38
star
14

sumologictoolbox

A GUI utility for performing Sumo Logic API tasks that would otherwise require scripting
Python
34
star
15

sumologic-collector-chef-cookbook

Chef Cookbook for installing and configuring the SumoLogic collector for the Sumo Logic service
Ruby
30
star
16

fluentd-output-sumologic

Fluentd output plugin to deliver logs or metrics to Sumo Logic.
Ruby
29
star
17

sumologic-documentation

Open Source repo for Sumo Logic documentation.
TypeScript
27
star
18

sumologic-net-appenders

Several appenders for .NET developers to use that send logs straight to SumoLogic.
C#
23
star
19

sumologic-opentelemetry-js

OpenTelemetry auto-instrumentation bundle for JavaScript
TypeScript
21
star
20

logstash-output-sumologic

Forward logstash data to Sumo Logic
Ruby
17
star
21

sumologic-kinesis-connector

Kinesis to Sumo Logic Connector
Java
15
star
22

sumologic-solution-templates

This repository contains deployment templates for Sumo Logic combo solutions.
HCL
15
star
23

sumo-java-client

Java client for the Sumo Logic API.
Java
12
star
24

terraform-sumologic-sumo-logic-integrations

Terraform modules for Sumo Logic resources
HCL
12
star
25

sumo-log4j-appender

Log4J Appender for Sumo Logic.
Java
11
star
26

sumologic-collector-puppet-module

Puppet module for installing Sumo Logic's collector.
Ruby
11
star
27

sumologic-jenkins-plugin

Java
11
star
28

cloud-siem-content-catalog

11
star
29

sumologic-log4j2-appender

Log4J 2 Appender for Sumo Logic.
Java
10
star
30

sumologic-collectd-plugin

Sumo Logic collectd Plugin: A collectd output plugin to send Carbon 2.0-formatted metrics to Sumo Logic.
Python
8
star
31

sumologic-logback-appender

Logback appender that sends data to a Sumo Logic HTTP source
Java
8
star
32

sumologic-azure-function

A collection of Azure functions to collect data and send to Sumo Logic cloud service
JavaScript
8
star
33

terraform-sumologic-sumo-logic-monitor

Package to setup SumoLogic Alert Monitors via Terraform
HCL
8
star
34

sumologic-lambda-extensions

Sumo Logic support for AWS Lambda extensions.
Go
7
star
35

sumologic-slack

Repository for Slack integration
Python
6
star
36

the-coffee-bar

A example demo application showcasing tracing capabilities.
Python
6
star
37

sumologic.github.io

Sumo public GitHub home page.
SCSS
6
star
38

sumologic-kubernetes-tools

sumologic-kubernetes-tools
Rust
5
star
39

dmail

Send Sumo Logic dashboards via email
JavaScript
5
star
40

quickstart-sumo-logic-log-centralization

AWS Quick Start Team
Python
5
star
41

sumologic-kafka-push

Utility for reading logs from a Kafka Topic and sending to Sumo Logic.
Scala
4
star
42

sumologic-opentelemetry-ios

Swift
4
star
43

sumologic-kubernetes-setup

Setup image for the Sumologic Kubernetes Collection
Dockerfile
4
star
44

sumologic-cloudfoundry-nozzle

A cloudfoundry nozzle that outputs to Sumologic
Go
3
star
45

sumologic-duo-security

Serverless collection solution for Duo security
Python
3
star
46

terraform-codegen

Scala
3
star
47

epigraph

Epigraph Framework
Java
3
star
48

sumologic-public-partner-apps

Public repository for SumoLogic apps
HCL
3
star
49

sumologic-servicenow-cmdb-ci-sync

The Sumo Logic to Service Now historical import script queries Sumo Logic for VMWare/AWS CloudTrail events and forwards the configuration items into ServiceNow.
Python
2
star
50

.github

2
star
51

lucene-compression

Lucene Directory that compresses the field data file (fdt)
Java
2
star
52

sumologic-mongodb-atlas

Repository for Sumo Logic collection for MongoDB Atlas
Python
2
star
53

sumologic-gsuitealertcenter

Collection for G Suite Alert Center
Python
2
star
54

SumoThreatResearch

PowerShell
2
star
55

sumologic-kubernetes-collection-helm-operator

Helm Operator for the Sumo Logic Kubernetes Collection Chart
Python
2
star
56

sumologic-java-http-core

Core Java components for sending data to Sumo Logic HTTP sources
Java
2
star
57

sumologic-otel-collector-packaging

Go
1
star
58

sumologic-openshift-images

Dockerfile
1
star
59

sumologic-otel-lambda

HCL
1
star
60

sumologic-orb

Report CircleCI job analytics to your SumoLogic dashboard.
Shell
1
star
61

sumologic-opentelemetry-android

Kotlin
1
star
62

sumologic-vmware

SumoLogic integration with vSphere
Python
1
star
63

sumologic-opentelemetry-python

Python
1
star
64

sumologic-netskope

Solution to pull data from Netskope to Sumo Logic
Python
1
star
65

sumologic-kubernetes-fluentd

Sumo Logic custom Fluentd image which is being used by sumologic-kubernetes-collection.
Ruby
1
star
66

sumologic-jfrog-xray

Repo for collection from JFrog Xray via its API
Python
1
star