Giter Club home page Giter Club logo

kafcat's Introduction

Build Docker image

Kafcat

Small utility to subscribe to kafka topic and print events to stdout.

Usage

You can either run locally or from a docker image:

docker run --rm docker.io/jpthomasset/kafcat:latest -b broker-url:9092 my-topic

Command line options

Usage: kafcat [--abort] [--quiet] [--broker <url>] [--registry <url>] [--key-deserializer <Deserializer>] [--value-deserializer <Deserializer>] [--format <string>] [--predicate <string>] [--number <N>] [--skip <N>] [--skip-null] [--timeout <N>] [--offset-reset <strategy>] [--since <iso-date-time>] <topic>

Consume events from a Kafka topic and print them to stdout

Options and flags:
    --help
        Display this help text.
    --version, -v
        Print the version number and exit.
    --abort, -a
        Abort on failure
    --quiet, -q
        Do not output failures to stderr
    --broker <url>, -b <url>
        Broker address and port
    --registry <url>, -r <url>
        Registry URL
    --key-deserializer <Deserializer>, -k <Deserializer>
        Key deserializer. Default is string. One of:
         * string (default)
         * long
         * avro
         * raw
    --value-deserializer <Deserializer>, -v <Deserializer>
        Value deserializer. Default is string. One of:
         * string (default)
         * long
         * avro
         * raw
    --format <string>, -f <string>
        Output format with templating. Default is "%k => %v". Valid template variables are:
         * %k Key
         * %v Value
         * %t Topic name
         * %p Partition
         * %o Offset
         * %d Timestamp
         * %h Headers
    --predicate <string>, -p <string>
        Predicate to filter records. You can use the following operators: ==, !=, ||, &&
         Then you can use value/key field names and constants:
         * value.field to extract a field from the value of the event
         * key.field to extract a field from the key of the event
         * topic
         * partition
         * offset
         * "some string" to use a string constant
         * 123.45 to use a number constant
        Here are some examples:
         * "value.id == 12"
         * "key.id == 12"
         * "value.sub.subage == 15"
         * "value.sub.subname == 'subname' || key.id == 12"
         * "topic == 'some topic' && value.id == 12"
    --number <N>, -n <N>
        Take N records and quit
    --skip <N>, -s <N>
        Skip N records and quit
    --skip-null
        Skip records with null values
    --timeout <N>
        Timeout after N seconds
    --offset-reset <strategy>
        Offset reset strategy. One of earliest or latest. Default to latest
    --since <iso-date-time>
        Start consuming from this timestamp (ISO Format)

kafcat's People

Contributors

jpthomasset avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.