Skip to content
Command-line ZPL processor
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
.gitignore
LICENSE.txt
README.org
zq.cr

README.org

zq is a lightweight processor for the ZeroMQ Property Language (4/ZPL)

Overview

ZPL is a simple configuration language. zq is a simple tool for processing streams of ZPL data.

Why does this exist?

Because we need simple configuration formats, and tools to work with them. ZPL is an excellent format, but lacks the convenience of a standalone tool for processing on the commandline.

Installation

Grab the latest version for your platform from the releases page and put it somewhere in your $PATH.

Usage

Given a ZPL file like this one (taken from the 4/ZPL RFC):

#
context
    iothreads = 1
    verbose = 1      #   Ask for a trace

main
    type = zmq_queue
    frontend
        option
            hwm = 1000
            swap = 25000000
            subscribe = "#2"
        bind = tcp://eth0:5555
    backend
        bind = tcp://eth0:5556
  

Using zq like this:

cat example.zpl | zq main frontend

Will output this:

option
  	  hwm = 1000
  	  swap = 25000000
  	  subscribe = #2
bind = tcp://eth0:5555

Using zq like this:

cat example.zpl | zq main backend bind

Will output this:

tcp://eth0:5556

Building from Source

zq is written in Crystal, with no external dependencies. Building it should be as simple as:

git clone https://github.com/colstrom/zq
cd zq
crystal build zq.cr

License

zq is available under the MIT License. See LICENSE.txt for the full text.

Contributors

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.