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 🙏

© 2024 – Pkg Stats / Ryan Hefner

miralog

v1.0.1

Published

a JSON log parsing tool for Ruckus cloud services

Downloads

3

Readme

A customized JSON log parser for Ruckus Alto services logs.

Installation

Install NodeJs and NPM

Please follow the link below to install nodeJS and npm on your machine link

Install miralog

sudo npm install -g miralog 

Usage

Ruckus cloud alto services output log is a stream of JSON objects. This is great for machine processing, but not friendly for reading by humans. A miralog tool is provided for transform output and for filtering.

To view the container logs in GKE, you can pipe the log to the 'miralog' command

$ kubectl -n dev logs wifi-broker-master--87-dd76ff99c-2p874 -c wifi-broker | miralog 

Or you can save the file locally first, then view the log using 'miralog'

$ kubectl -n dev logs wifi-broker-master--87-dd76ff99c-2p874 -c wifi-broker > tmp.log
$ miralog tmp.log

The complete help on the usage of 'miralog' can be find by

$ miralog --help

Usage:
  miralog [OPTIONS] [FILE ...]
  ... | miralog [OPTIONS]

Filter and pretty-print Ruckus Alto log file content.

General options:
  -h, --help    print this help info and exit
  --version     print version of this command and exit

Filtering options:
  -s, --severity LEVEL
                Only show messages at or above the specified severity.
  -c, --condition CONDITION
                Run each log message through the condition and
                only show those that return truish. E.g.:
                    -c 'this.thread == "main"'
                    -c 'this.severity == "DEBUG"'
                    -c 'this.message.indexOf("boom") != -1'
                "CONDITION" must be legal JS code. `this` holds the log record.
  --strict      Suppress all but legal Alto JSON log lines. By default
                non-JSON, and non-Alto lines are passed through.

Output options:
  --pager       Pipe output into `less` (or $PAGER if set), if
                stdout is a TTY. This overrides $MIRALOG_NO_PAGER.
                Note: Paging is only supported on node >=0.8 and miralog [OPTIONS] [FILE ...] usage.
  --no-pager    Do not pipe output into a pager.
  --color       Colorize output. Defaults to try if output
                stream is a TTY.
  --no-color    Force no coloring (e.g. terminal doesn't support it)
  -o, --output MODE
                Specify an output mode/format. One of
                  long: (the default) pretty
                  json: JSON output, 2-space indent
                  json-N: JSON output, N-space indent, e.g. "json-4"
                  inspect: node.js `util.inspect` output
                  short: like "long", but more concise
                  simple: severity, followed by "-" and then the message
  -j            shortcut for `-o json`
  -0            shortcut for `-o miralog`
Environment Variables:
  MIRALOG_NO_COLOR    Set to a non-empty value to force no output 
                     coloring. See "--no-color".
  MIRALOG_NO_PAGER    Disable piping output to a pager. 
                     See "--no-pager".

Versioning

All versions are <major>.<minor>.<patch> which will be incremented for breaking backward compat and major reworks, new features without breaking change, and bug fixes, respectively. tl;dr: Semantic versioning.

Acknowledgments

This tool is based on bunyan CLI tool at https://github.com/trentm/node-bunyan.