npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentix-e/log-parser-cli

v1.0.0

Published

Command-line interface for the log-parser framework. Parse logs from files, stdin, or remote sources.

Readme

@agentix-e/log-parser-cli

Command-line interface for the log-parser framework -- parse logs from files, stdin, or remote sources with Commander.

npm License

Overview

@agentix-e/log-parser-cli provides the log-parser command-line tool for quick, one-shot log parsing from the terminal. Built on Commander, it wraps LogParserPipeline (core) and NodeStreamAdapter (node) to stream large files line-by-line and output parsed templates as JSON.

Supports multiple log format adapters: Syslog (RFC 5424/3164), Apache Common/Combined, JSON, and auto-detection.

Installation

# Global install
npm install -g @agentix-e/log-parser-cli @agentix-e/log-parser-core @agentix-e/log-parser-node commander

# Or run directly with npx
npx @agentix-e/log-parser-cli parse -i /var/log/syslog

# As a project dependency
npm install @agentix-e/log-parser-cli

Quick Start

Parse a Log File

log-parser parse -i /var/log/nginx/access.log

# Output (one JSON per line):
# {"logId":1,"template":"<IP> - - [<TIMESTAMP>] \"<*> /<PATH> HTTP/1.1\" <NUM> <NUM>","source":"drain"}
# {"logId":2,"template":"<IP> - - [<TIMESTAMP>] \"<*> /<PATH> HTTP/1.1\" <NUM> <NUM>","source":"drain"}

Parse with a Specific Adapter

# Syslog format
log-parser parse -i /var/log/syslog -a syslog

# Apache access log format
log-parser parse -i /var/log/apache2/access.log -a apache

# JSON log format
log-parser parse -i /var/log/app.json -a json

# Auto-detection (default)
log-parser parse -i /var/log/messages -a auto

Pipe from stdin

# Pipe logs from another command
cat /var/log/syslog | while IFS= read -r line; do
  echo "$line" | log-parser parse -i /dev/stdin
done

# Or use the streaming adapter programmatically via NodeStreamAdapter

Show Parsing Statistics

log-parser stats -i /var/log/nginx/access.log

# Output:
# {
#   "totalProcessed": 1250000,
#   "templateCount": 47,
#   "missCount": 0,
#   "llmCallCount": 0,
#   "uptime": 234
# }

Help and Version

log-parser --help

# Commands:
#   parse     Parse log messages
#   stats     Show parsing statistics
#   help      Display help for command

log-parser parse --help

# Options:
#   -i, --input <file>     Input log file path (required)
#   -a, --adapter <type>   Log format adapter (syslog, apache, json, auto) (default: "auto")

log-parser --version
# 0.1.0

Programmatic Usage

You can also use the CLI as a library to embed log-parser commands in your own CLI tools:

import { createCLI } from '@agentix-e/log-parser-cli';

const program = createCLI();

// Add custom commands
program
  .command('custom-parse')
  .option('-o, --output <format>', 'Output format (json, csv)', 'json')
  .action(async (opts) => {
    // Your custom logic here
  });

program.parse(process.argv);

Adapter Reference

| Adapter | Flag | Description | |---------|------|-------------| | syslog | -a syslog | Parses RFC 5424/3164 syslog messages. Extracts timestamp, hostname, facility, severity. | | apache | -a apache | Parses Apache Common and Combined log format. Handles quoted fields, user agents. | | json | -a json | Parses JSON log lines. Extracts the message field for template extraction. | | auto | -a auto | Auto-detects the format per line. Falls back to raw line content on unrecognized formats. |

API Reference

createCLI()

Returns a Commander Command instance with parse and stats subcommands registered.

import { createCLI } from '@agentix-e/log-parser-cli';

const program = createCLI();
program.parse(process.argv);

The returned Command is a standard Commander program -- you can add additional subcommands, modify descriptions, or integrate into a larger CLI.

Related Packages

| Package | Purpose | |---------|---------| | @agentix-e/log-parser-core | Core parsing engine (required) | | @agentix-e/log-parser-node | Node.js I/O adapters used by the CLI for file streaming | | @agentix-e/log-parser-server | REST API alternative for long-running services | | @agentix-e/log-parser-llm | Add LLM enhancement when using programmatic API |

License

MIT