Skip to content
This repository has been archived by the owner on Apr 2, 2018. It is now read-only.

Commit

Permalink
Update README.md with accurate config
Browse files Browse the repository at this point in the history
[finishes #137179173]

Signed-off-by: Chris Hendrix <[email protected]>
  • Loading branch information
mariash authored and Chris Hendrix committed Jan 27, 2017
1 parent 85e34b5 commit cd0a3a1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@

![Black Box Flight Recorder](http://i.imgur.com/sCSNdzU.jpg)

## about
## About

Applications often provide only a limited ability to log to syslog and often
don't log in a consistent format. I also think that syslog is an operational
concern and the application should not know about where it is logging. Blackbox
is an experiment to decouple syslogging from an application without messing
about with syslog configuration (which is tricky on BOSH VMs).

Blackbox will tail specified files and forward any new lines to a syslog
server.
Blackbox will tail all files in sub-directories of a specified `source_dir`, and forward any new lines to a syslog server.

## usage
## Usage

```
blackbox -config config.yml
Expand All @@ -26,20 +25,31 @@ The configuration file schema is as follows:
``` yaml
hostname: this-host

destination:
transport: udp
address: logs.example.com:1234
syslog:
destination:
transport: udp
address: logs.example.com:1234

sources:
- path: hello.txt
tag: hello
source_dir: /path/to/log-dir
```
Each file can be sent with a different tag. Currently the priority and facility
are hardcoded to `INFO` and `user`. However, allowing customisation of these
per source would not be difficult.
Consider the case where `log-dir` has the following structure:

## installation
```
/path/to/log-dir
|-- app1
| |-- stdout.log
| `-- stderr.log
`-- app2
|-- foo.log
`-- bar.log
```
Any new lines written to `app1/stdout.log` and `app1/stderr.log` get sent to syslog tagged as `app1`, while new lines written to `app2/foo.log` and `app2/bar.log` get sent to syslog tagged as `app2`.
Currently the priority and facility are hardcoded to `INFO` and `user`.
## Installation
```
go get -u github.com/concourse/blackbox/cmd/blackbox
Expand Down
5 changes: 0 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil
}

type SyslogSource struct {
Path string `yaml:"path"`
Tag string `yaml:"tag"`
}

type SyslogConfig struct {
Destination syslog.Drain `yaml:"destination"`
SourceDir string `yaml:"source_dir"`
Expand Down

0 comments on commit cd0a3a1

Please sign in to comment.