• Stars
    star
    108
  • Rank 320,040 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Tango is a command-line tool for analyzing access logs ๐Ÿ’ƒ

Tango

Tango

Tool to get insights from the server access logs


Tango License Gitter

Tango is a dependency-free command-line tool for analyzing access logs ๐Ÿ’ƒ

Currently, work on this project is in progress. However, a few pre-releases are ready available to use ๐ŸŽ‰

Table of Contents

Installation

macOS

Tango can be installed on macOS via Homebrew:

brew tap roma-glushko/tango
brew install roma-glushko/tango/tango

To upgrade, try to run:

brew upgrade tango

Linux

Tango is available on Linux via Snapcraft. This means that Tango can be installed on:

To upgrade, try to run:

snap refresh tango

Windows

Tango can be installed on Windows via Scoop:

scoop bucket add tango https://github.com/roma-glushko/scoop-tango.git
scoop install tango

To upgrade, try to run:

scoop update tango

Usage

List of available commands:

tango help

Tango Version:

tango -v

Global Options

Filters

// IP filters
tango --ip-filter "127.0.0.1" custom -l access-log.log -r custom.csv
tango --keep-ip-filter "8.8.8.8" custom -l access-log.log -r custom.csv
// URI filters
tango --uri-filter "/test-page" custom -l access-log.log -r custom.csv
tango --keep-uri-filter "/admin/" custom -l access-log.log -r custom.csv
// Time Frame filter
tango --keep-time-filter "2019-09-15 04:16:00 -0400" --keep-time-filter "2019-09-15 04:35:00 -0400" custom -l access-log.log -r custom.csv
// User Agent filters
tango --ua-filter "iPhone OS 12_3_1 like Mac OS X" custom -l access-log.log -r custom.csv
tango --keep-ua-filter "iPhone OS 12_3_1 like Mac OS X" custom -l access-log.log -r custom.csv
// Asset filter
tango --asset-filter "/pub/static/" --asset-filter "/pub/media/" custom -l access-log.log -r custom.csv
// System IP filter
tango --system-ips "127.0.0.1"  --system-ips "1.2.3.4" custom -l access-log.log -r custom.csv

Other

// Base URL info
tango --base-url "https://example.com/" custom -l access-log.log -r custom.csv

Report Commands

Custom Reports

tango --keep-uri-filter "/newsletter/subscriber/new/" custom -l access-log.log -r custom.csv

Use cases:

  • generate a report with all requests from a certain IP
  • generate a report with all requests to a certain URL

Geo Reports

tango geo -l access-log.log -r custom.csv

Geo Report uses MaxMind Geo lib to get Geo information. See Geo Lib command for more info.

Use cases:

  • collects geo information about all IPs that requested the website
  • get request distribution by IP with geo information
  • see all IPs sorted by countries/continents/cities

Example of the report:

Example of the report
IP Country City Continent Sample Request Browser Agent Count of Requests
46.229.173.68 United States Ashburn North America /robots.txt Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) 362
40.77.167.91 United States Boydton North America /contact-us Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) 3
178.154.171.62 Russia Europe / Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots) 34

Browser Reports

tango browser -l access-log.log -r custom.csv

Use cases:

  • check how many requests were sent by crawlers
  • check what kind of browsers requested the website
  • check bandwith that was transmitted to all kind of browsers
  • check what crawlers requested the website
Example of the report
Category Browser Requests Bandwith Sample URL User Agents
Crawlers bingbot 629 28.8 MB /black-bag-product Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)
Chrome Chrome 131998 1.3 GB /gears/bags?p=3 Mozilla/5.0 (Linux; Android 8.0.0; G8441) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36
Mozilla/5.0 (Linux; Android 9; SM-G960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 MobileSafari/537.36
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36

Request Reports

tango request -l access-log.log -r custom.csv

Use cases:

  • check how many requests were sent to a certain URL
  • check all URLs that were responded with 404/50X code
  • find requests from security scanners (sort by response codes and look at 404/50X codes which were requested only 1 time)
Example of the report
Path Requests Response Code Referer URLs
/media/catalog/product/black-bag.jpg 20 200 /black-bag
/admin/sales/order/view/order_id/1234 4 200 /admin/sales/order/index/order_id/123
/test321 1 404 /

Pace Reports [Experimental]

tango pace -l access-log.log -r custom.csv

Use cases:

  • check which IPs and how many requests they made during a certain time frame
  • check count of requests per minutes/hours
Example of the report
Hour Group Minute Group IP Browser Pace (req/min) Pace (req/hour)
2020-02-10 04 h 35
2020-02-10 04:06 15
51.15.191.180 Barkrowler/0.9 (+https://babbar.tech/crawler) 10
54.36.150.167 Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/) 5
2020-02-10 04:06 15
2020-02-10 04:07 20
66.249.76.89 Googlebot-Image/1.0 20
2020-02-10 04:07 20
2020-02-10 04 h 35

Journey Reports [Experimental]

tango journey -l access-log.log -r custom.csv

Misc Commands

Geo Lib

// Install geo library to be able to generate geo reports
tango geo-lib

Tango uses the MaxMind GeoLite2-City database and stores it under:

  • macOS - /Users/[username]/.tango/GeoLite2-City.mmdb

To be able to manage the Geo lib, you need to generate acceses under MaxMind Account page

Config File

Put the similar content to a .tango.yaml file under your working directory where you analyze logs:

"asset-filter":
  - "/pub/static/"
  - "/pub/media/"
  - "/media/"
  - "/static/"
"ip-filter":
  - "127.0.0.1"
"system-ips":
  # Fastly IPs
  - "23.235.32.0/20"
  - "43.249.72.0/22"
  - "103.244.50.0/24"
  - "103.245.222.0/23"
  - "103.245.224.0/24"
  - "104.156.80.0/20"
  - "151.101.0.0/16"
  - "157.52.64.0/18"
  - "167.82.0.0/17"
  - "167.82.128.0/20"
  - "167.82.160.0/20"
  - "167.82.224.0/20"
  - "172.111.64.0/18"
  - "185.31.16.0/22"
  - "199.27.72.0/21"
  - "199.232.0.0/16"

More Repositories

1

awesome-distributed-system-projects

๐Ÿš€ List of distributed system projects for inspiration and learning to build distributed services from real world examples
662
star
2

magento2-dev-plus-exam

๐Ÿ“šMagento 2 Certified Professional Developer Plus Exam
PHP
77
star
3

hyx

๐Ÿง˜โ€โ™€๏ธ Lightweight fault tolerant primitives for your modern asyncio Python microservices
Python
72
star
4

mage-di-analyzer

๐Ÿ•ต๏ธโ€โ™‚๏ธCalculates and reports how Magento modules affect Magento2 DI compilation process and boostrapping process
PHP
19
star
5

magento2-training-camp

๐Ÿ“šMagento 2 Solution Specialist Training Camp
8
star
6

mage2kata.guru

List of Magento2 katas that helps to practice an essential everyday tasks
HTML
8
star
7

rock-paper-scissors

๐ŸŽฒ Application of Computer Vision to the classic game Rock-Paper-Scissors
Jupyter Notebook
6
star
8

eyewear

๐Ÿ‘“ Inspect, monitor and track Magento2 database growth
PHP
6
star
9

grumphp-magento2

Magento 2 specific tasks for GrumPHP checker
PHP
6
star
10

notifykit

๐Ÿ‘€ A performant, cross-platform, modern Pythonic toolkit for building applications that need watching filesystem events
Rust
6
star
11

no-cache-extension

๐Ÿ”ฅEnsure that you see your page without client and server caches
JavaScript
6
star
12

morty

๐Ÿ”ฌ Lightweight experiment and configuration manager for small ML/DL projects and Kaggling
Python
5
star
13

socket.io-redis-emitter

โšก๏ธ An async Redis-based Socket.IO emitter for Python.
Python
5
star
14

hirsh

๐Ÿ“Ÿ Resilient monitoring system that detects utility outages in unreliable environments (e.g. IoT, RaspberryPi, etc)
Python
4
star
15

magento2-opensource-mirror-lab

โš—๏ธThis repository describes how to use Magento 2 OpenSource Mirror in order to get more information concerning version differences
4
star
16

awesome-experiment-tracking

Curated list of available experiment tracking frameworks
4
star
17

m2code-gen

A CLI tool ๐Ÿ— that helps to speed up development of typical Magento 2 code by generating templates. You just need to think about bussiness logic, routine will be reduced
PHP
3
star
18

module-watcher

Project Update Watcher - a simple PHP system for watching updates in your project
CSS
3
star
19

magento2-k6-load-tests

3
star
20

kaggle-house-prices

๐Ÿ˜ Ames house dataset modelled and explained
Jupyter Notebook
3
star
21

leetcode-solutions

๐ŸŒณ Solutions for some of Leetcode coding problems sorted by topics
Python
3
star
22

migdalor

๐Ÿ”† A Kubernetes native peer discovery and cluster membership management library for your modern Python microservices
Python
2
star
23

genart-prompts

๐ŸŽจ A list of modifiers to make your generative art prompts fancier
2
star
24

kaggle-wine-quality

๐Ÿท Quality analysis of red and white variants of the Portuguese "Vinho Verde" wine
Jupyter Notebook
2
star
25

roma-glushko.github.io

๐Ÿ‘จโ€๐Ÿ’ป My Personal Website
MDX
2
star
26

seth-godin-sentance-generator

Sentence Generator in Seth Godin's style ๐ŸŽค
Jupyter Notebook
2
star
27

xgress

๐Ÿ” Visualize communication between your microservices based on Kubernetes network policies
TypeScript
2
star
28

spicy-rice

๐ŸšAn open source named entity annotator for your tiny/hobby spaCy NLP projects
JavaScript
2
star
29

graphql-ce-docker

๐ŸณA docker environment for contributing into Magento 2 GraphQl project
Dockerfile
2
star
30

resbeat

๐Ÿ”Š Broadcast resource utilization of the container to the rest of the system via HTTP/websocket protocols
Go
2
star
31

testcrd

Unit test your Kubernetes Custom Resource Definitions (CRDs) ๐Ÿ› ๏ธ
Go
2
star
32

networksim

Simulate network communication with SimPy
2
star
33

yew

๐ŸŒฟ Build automations that require to understand dependencies in your Python codebase.
Python
2
star
34

awesome-platforms

๐Ÿ“ฆ A list of awesome open source platforms, complete end-to-end applications
2
star
35

guess-game

Guess a number from 1 to 100 in as few shots as possible
Rust
1
star
36

broom

๐Ÿงน Cleans my screenshots and other files according to a cleaning plan
Rust
1
star
37

jackdaoud-marketing-analysis

Jupyter Notebook
1
star
38

cookie-cats-ab-test-analysis

Jupyter Notebook
1
star
39

nemesis

Python
1
star
40

magento2-dir-buster

Python
1
star
41

glushko-productivity-framework

1
star
42

keycast

๐Ÿ”Š A replicated in-memory cache for Python
1
star
43

hivesrv

๐Ÿ ASGI Python3 server for the Kubernetes Era
Python
1
star
44

sandkube

๐Ÿ› ๏ธ A Kubernetes sandbox cluster
Makefile
1
star
45

numpy-katas

๐Ÿงฎ Exercises to sharp scientific computations with Numpy
Jupyter Notebook
1
star
46

monolog-parser

๐Ÿ› Parser for your monolog records
PHP
1
star
47

roma-glushko

My Profile Description
1
star
48

awesome-python-at-scale

๐Ÿš€ List of resources about running Python on scale
1
star
49

image-color-clustering

Jupyter Notebook
1
star
50

kiwidb

๐Ÿฅ a distributed key-value database [edu]
Go
1
star
51

awesome-formal-software-analysis

๐Ÿ“ A list of projects that helps to analyse and asses complex software systems
1
star
52

cargo

An attempt to implement The DDD Sample App in idiomatic Golang
Go
1
star