Skip to content

Instantly share code, notes, and snippets.

@martinhynar
Last active August 29, 2015 14:13
Show Gist options
  • Save martinhynar/17ae0f3b2c4f498f8718 to your computer and use it in GitHub Desktop.
Save martinhynar/17ae0f3b2c4f498f8718 to your computer and use it in GitHub Desktop.
Example logomotive configuration file
(ns configuration
(:require [logomotive.api.input :as input]
[logomotive.api.output :as output]
[logomotive.api.transform :as transform]
))
; Read events from stdin, keep it as-is
(input/stdin {:format :plain})
; Read events from UDP on port 1984, keep it as-is
(input/udp {:port 1984})
; Read events sent by collectd, implicitly assuming that structure is of collectd (Binary protocol)
; This input listens on UDP port 25826
(input/collectd {:port 25826})
; Into all events, add tag :logomotive
(transform/tag {:condition-fn (constantly true)
:add [:logomotive]})
; Print all events on stdout
(output/stdout {})
; Print all events to file, one json document per line. Only events received from input of type :udp
(output/file {:path "/tmp/example.log"
:structure :jsonline
:condition-fn (fn [event] (= :udp (:type-in event)))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment