Hotdog is a syslog-to-Kafka forwarder which aims to get log entries into Apache Kafka as quickly as possible.
Go to file
R Tyler Croy cfefbe14b2 Add the logs-unknown topic for testing 2020-04-16 20:59:40 -07:00
src Correctly route topics based on variable substitutions for jmespath 2020-04-15 13:04:53 -07:00
.gitignore Add the `merge` action for merging JSON log lines with pre-defined JSON data 2020-04-05 17:07:43 -07:00
Cargo.lock Refactoring and improve the handling of merge actions 2020-04-14 22:00:36 -07:00
Cargo.toml Refactoring and improve the handling of merge actions 2020-04-14 22:00:36 -07:00
LICENSE.txt Add a readme and license, just good hygiene there 2020-04-04 14:43:49 -07:00
README.adoc Correctly route topics based on variable substitutions for jmespath 2020-04-15 13:04:53 -07:00
docker-compose.yml Add the logs-unknown topic for testing 2020-04-16 20:59:40 -07:00
example.log Correctly route topics based on variable substitutions for jmespath 2020-04-15 13:04:53 -07:00
hotdog.yml Correctly route topics based on variable substitutions for jmespath 2020-04-15 13:04:53 -07:00
tsung.xml Add the logs-unknown topic for testing 2020-04-16 20:59:40 -07:00

README.adoc

<html lang="en"> <head> </head>

Hotdog!

Hotdog is a syslog-to-Kafka forwarder which aims to get log entries into Apache Kafka as quickly as possible.

Hotdog 0.1.0
R Tyler Croy <rtyler@brokenco.de
Forward syslog over to Kafka with ease

USAGE:
    hotdog [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c, --config <FILE>       Sets a custom config file [default: hotdog.yml]
    -t, --test <TEST_FILE>    Test a log file against the configured rules

Configuration

Hotdog is configured by the hotdog.yml file, which has a very fluid syntax at the moment. The two main sections are the global and rules blocks.

Rules defined in the configuration can be tested against an example log file in order to verify that the right rules are matching the expected log inputs, for example:

 RUST_LOG=info ./target/debug/hotdog -t example.log
Line 1 matches on:
         - ^hello\s+(?P<name>\w+)?
         - .*
Line 2 matches on:
         - .*
Line 3 matches on:
         - .*
Line 4 matches on:
         - ^\{(.*)?\}$
         - .*

Global

The global configuration block helps configure hotdog itself, namely the port it listens on, etc.

Rules

Hotdogs rules define how it should handle and route the syslog messages it receives.

Actions

Actions determine what hotdog should do with the given log line when it receives it.

Some actions, such as Replace, can perform variable substitutions on log line. The variables available are a combination of the built-in variables listed below, and whatever named groups exist in the regex field of the Rules.

Caution

Named groups will override any built-in variables at the time of substitution, so be careful you are not naming your groups anything which might overlap with the built-in variable names

Table 1. Built-in Variables
Name Description

msg

The original log line message sent along from the syslog sender.

Forward

The forward action will imply the Stop action when used.

Merge
Table 2. Parameters
Key Value

json

A YAMl map which will be merged with the JSON object deserialized from the matched log line.

The merge action will only work when the log line is a JSON object. JSON arrays, or other arbitrary strings will not merge properly, and cause all subsequent actions for the given rule to be aborted.

Replace
Table 3. Parameters
Key Value

template

A Handlebars-style template which can be used to output a modified message.

The template may utilize the matched and built-in variables in order to generate a modified message. The output is only available to subsequent actions defined after the replace action. Subsequent rules in the chain will not utilize this generated message.

Stop

Development

Hotdog is tested against the latest Rust stable. A simple cargo build should compile a working hotdog binary for your platform.

On Linux systems it is easy to test with:

logger --server 127.0.0.1  -T -P 1514 "hello world"
</html>