Skip to content

Commit

Permalink
add cli with a command to filter logs (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
vish9812 authored Feb 5, 2024
1 parent 38947f6 commit 775c0b4
Show file tree
Hide file tree
Showing 12 changed files with 676 additions and 13 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Analog

Analog is a powerful tool designed for analyzing and visualizing log files. It provides several features to help you efficiently work with your log data. Whether you need to identify common patterns, compare logs from different versions of your application, or filter logs based on various criteria, this app has you covered.
Analog is a powerful tool designed for analyzing the log files. It provides several features to help you efficiently work with your log data. Whether you need to identify common patterns, compare logs from different versions, or filter logs based on various criteria, this app has you covered.

## Features

### CLI

Manage _multiple_ log files directly from the command line with the Analog CLI tool.

For details, refer to its [README.md](https://github.com/vish9812/analog/blob/main/src/cmd/README.md) file.

### Web UI

- **Summary View**: Quickly gain insights into your log file with the Summary View. It provides frequencies of the following key aspects:

- Top Logs
Expand All @@ -23,11 +31,11 @@ Analog is a powerful tool designed for analyzing and visualizing log files. It p

- **Log File Comparison**:

- **Compare Two Log Files**: Compare two log files and see newly added or removed log entries.
- **Compare Two Log Files**: Compare two log files and identify what changed by reviewing newly added or removed log entries.

- **Create and Download a Filtered Subset**: Define filtering criteria to extract a specific subset of logs. You can also compare two subsets of a single log file to track changes.

- **Time Jumps**: Navigate through log data in subsets repeating after every few minutes.
- **Time Jumps**: Navigate through log data in subsets whenever there is a break of more than 13 minutes.

- **Highlighted JSON Syntax**: Log entries with JSON data are automatically highlighted for improved readability.

Expand All @@ -36,7 +44,7 @@ Analog is a powerful tool designed for analyzing and visualizing log files. It p
## Prerequisite

- Ensure you have Python 3 installed on your system then you can simply execute the `analog script` to run the app.
- Otherwise run the `index.html` manually on any server of your preference.
- Otherwise host the `index.html` manually on any server of your preference.

## Getting Started

Expand All @@ -50,7 +58,7 @@ Follow these steps to run the app:

4. Execute the `analog script` to start the app.

- For Non-Windows, just execute the script `./analog.sh`.
- For Non-Windows, execute the script `./analog.sh`.
- For Windows, use powershell:
- _Unblock_(one-time operation) the powershell file `analog.ps1` to be allowed to execute on the system: `Unblock-File .\analog.ps1`
- Execute the script `.\analog.ps1`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "vitest --silent",
"test-logs": "vitest",
"coverage": "vitest run --coverage --silent",
"build": "vite build && cp analog.sh analog && cp analog.ps1 analog && zip -r analog.zip analog",
"build": "vite build && cp analog.sh analog && cp analog.ps1 analog && bun build ./src/cmd/index.ts --compile --outfile ./analog/analog && zip -r analog.zip analog",
"preview": "vite preview"
},
"license": "MIT",
Expand Down
175 changes: 175 additions & 0 deletions src/cmd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
15 changes: 15 additions & 0 deletions src/cmd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Analog CLI

Analog CLI is a tool for managing log files.

## Installation

The CLI comes with the Analog app downloaded from the [Releases Page](https://github.com/vish9812/analog/releases).

## Commands:

- **Filter**: Filters all files from a given folder within a time range and generates a single time-sorted log file.

## Usage:

Execute `/path/to/cli/analog --help` to see the usage.
Binary file added src/cmd/bun.lockb
Binary file not shown.
6 changes: 6 additions & 0 deletions src/cmd/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface ICmd {
help(): void;
run(): Promise<void>;
}

export type { ICmd };
Loading

0 comments on commit 775c0b4

Please sign in to comment.