Home

Awesome

<p align="center"> <img alt="Tango" src="https://raw.githubusercontent.com/roma-glushko/tango/master/doc/tango-logo.png" height="90" /> <h3 align="center">Tango</h3> <p align="center">Tool to get insights from the server access logs</p> </p>
<p align="center"> <a href="https://travis-ci.org/roma-glushko/tango" alt="Build Status"><img alt="Tango" src="https://travis-ci.org/roma-glushko/tango.svg?branch=master" /></a> <a href="https://github.com/roma-glushko/tango/blob/master/LICENSE" alt="License"><img alt="License" src="https://img.shields.io/github/license/roma-glushko/tango" /></a> <img src="https://img.shields.io/badge/WIP-Work%20In%20Progress-yellow.svg" /> <a href="https://gitter.im/roma-glushko-tango/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge" alt="Gitter"><img alt="Gitter" src="https://badges.gitter.im/roma-glushko-tango/community.svg" /></a> </p> <p align="center"> <img src="https://raw.githubusercontent.com/roma-glushko/tango/master/doc/tango.gif" width="500px" /> </p>

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

<p align="center"> <img src="https://raw.githubusercontent.com/roma-glushko/tango/master/doc/tango-install-homebrew.gif" width="500px" /> </p>

Tango can be installed on macOS via <a href="https://brew.sh/">Homebrew</a>:

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 <a href="https://snapcraft.io/tango">Snapcraft</a>. This means that Tango can be installed on:

To upgrade, try to run:

snap refresh tango

Windows

Tango can be installed on Windows via <a href="https://scoop.sh/">Scoop</a>:

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:

Geo Reports

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

Geo Report uses MaxMind Geo lib to get Geo information. See <a href="#geo-lib">Geo Lib command</a> for more info.

Use cases:

Example of the report:

<details> <summary>Example of the report</summary>
IPCountryCityContinentSample RequestBrowser AgentCount of Requests
46.229.173.68United StatesAshburnNorth America/robots.txtMozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)362
40.77.167.91United StatesBoydtonNorth America/contact-usMozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)3
178.154.171.62RussiaEurope/Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)34
</details>

Browser Reports

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

Use cases:

<details> <summary>Example of the report</summary>
CategoryBrowserRequestsBandwithSample URLUser Agents
Crawlersbingbot62928.8 MB/black-bag-productMozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)
ChromeChrome1319981.3 GB/gears/bags?p=3Mozilla/5.0 (Linux; Android 8.0.0; G8441) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36<br>Mozilla/5.0 (Linux; Android 9; SM-G960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 MobileSafari/537.36<br>Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36<br>Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36
</details>

Request Reports

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

Use cases:

<details> <summary>Example of the report</summary>
PathRequestsResponse CodeReferer URLs
/media/catalog/product/black-bag.jpg20200/black-bag
/admin/sales/order/view/order_id/12344200/admin/sales/order/index/order_id/123
/test3211404/
</details>

Pace Reports [Experimental]

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

Use cases:

<details> <summary>Example of the report</summary>
Hour GroupMinute GroupIPBrowserPace (req/min)Pace (req/hour)
2020-02-10 04 h35
2020-02-10 04:0615
51.15.191.180Barkrowler/0.9 (+https://babbar.tech/crawler)10
54.36.150.167Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/)5
2020-02-10 04:0615
2020-02-10 04:0720
66.249.76.89Googlebot-Image/1.020
2020-02-10 04:0720
2020-02-10 04 h35
</details>

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:

To be able to manage the Geo lib, you need to generate acceses under <a href="https://www.maxmind.com/en/accounts/current/license-key">MaxMind Account</a> 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"