firehose-to-syslog

command module
v0.0.0-...-385dfa6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2015 License: MIT Imports: 10 Imported by: 0

README

This nifty util aggregates all the events from the firehose feature in CloudFoundry.

To make it work unless you want to run with the admin user, you will need the following in your CF manifest.

	uaa:
		clients:
			cf:
				scope: '....,doppler.firehose'
	scim:
		users:
			- firehoseuser|firehosepassword|doppler.firehose

Then you should be able to do this and get some nice logs.

./firehose-to-logstash \
	--domain=cf.installation.domain.com \
	--user=username \
	--password=password \
	--debug

{"cf_app_id":"e626413b-f1f8-436d-8963-c46f7cb345eb","cf_app_name":"php-diego-one","cf_org_id":"ebd95a83-5b6a-43ff-af67-a234ece3fb78","cf_org_name":"GWENN","cf_space_id":"a2e4c75b-fe02-4078-abfb-87539352aeac","cf_space_name":"GWENN-SPACE","cpu_percentage":1.4523587130944957,"disk_bytes":0,"event_type":"ContainerMetric","instance_index":0,"level":"info","memory_bytes":14110720,"msg":"","origin":"executor","time":"2015-04-17T13:59:52-07:00"}

Options

usage: firehose-to-syslog [<flags>]

Flags:
  --help              Show help.
  --debug             Enable debug mode. This disables forwarding to syslog
  --domain="10.244.0.34.xip.io" Domain of your CF installation.
  --syslog-server=SYSLOG-SERVER
                      Syslog server.
  --subscription-id=firehose  Id for the subscription.
  --user=admin      Admin user.
  --password=admin  Admin password.
  --skip-ssl-validation Please don\'t
  --events=LogMessage Comma seperated list of events you would like. Valid options are HttpStart, HttpStop, Heartbeat, HttpStartStop, LogMessage, ValueMetric, CounterEvent, Error, ContainerMetric
  --boltdb-path='my.db' Bolt Database path
  --cc-pull-time=60s  CloudController Pooling time in sec
  --version           Show application version.

Event documentation

See the dropsonde protocol documentation for details on what data is sent as part of each event.

Caching

We use boltdb for caching application name, org and space name.

We have 2 caching strategies:

  • Pull all application data on start
  • Pull by application id if not cached yet
  • Pull every "cc-pull-time" all applications data

To build

# Setup repo
go get github.com/cloudfoundry-community/firehose-to-syslog
cd $GOPATH/src/github.com/cloudfoundry-community/firehose-to-syslog

# Build binary
godep go build

Deploy with Bosh

logsearch-for-cloudfoundry

Run agains a bosh-lite CF deployment

godep go run main.go \
	--debug \
	--skip-ssl-validation

Parsing the logs with Logstash

There is a grok-pattern folder with a couple of filters for app and and routing logs. But I would strongy encourage to use logsearch-for-cloudfoundry that provides >= functionality but in a nicer package.

Devel

This is a Git Flow project. Please fork and branch your features from develop.

Contributors

  • Ed King - Added support to skip ssl validation.
  • Mark Alston - Added support for more events and general code cleaup.
  • Etourneau Gwenn - Added validation of selected events and general code cleanup, caching system..

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/alecthomas/units
Package units provides helpful unit multipliers and functions for Go.
Package units provides helpful unit multipliers and functions for Go.
_workspace/src/github.com/boltdb/bolt
Package bolt implements a low-level key/value store in pure Go.
Package bolt implements a low-level key/value store in pure Go.
_workspace/src/github.com/cloudfoundry/noaa/events
Package events is a generated protocol buffer package.
Package events is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/fieldpath
This packages is used to create compiled fieldpaths for selective unmarshaling.
This packages is used to create compiled fieldpaths for selective unmarshaling.
_workspace/src/github.com/gogo/protobuf/fieldpath/fieldpath-gen
Generates fieldpath-generated.go and fieldpath-generated_test.go in github.com/gogo/protobuf/fieldpath , since writing code for each native go type and native proto type can be quite tedious.
Generates fieldpath-generated.go and fieldpath-generated_test.go in github.com/gogo/protobuf/fieldpath , since writing code for each native go type and native proto type can be quite tedious.
_workspace/src/github.com/gogo/protobuf/gogoproto
Package gogoproto provides extensions for protocol buffers to achieve: - fast marshalling and unmarshalling.
Package gogoproto provides extensions for protocol buffers to achieve: - fast marshalling and unmarshalling.
_workspace/src/github.com/gogo/protobuf/plugin/defaultcheck
The defaultcheck plugin is used to check whether nullable is not used incorrectly.
The defaultcheck plugin is used to check whether nullable is not used incorrectly.
_workspace/src/github.com/gogo/protobuf/plugin/description
The description (experimental) plugin generates a Description method for each message.
The description (experimental) plugin generates a Description method for each message.
_workspace/src/github.com/gogo/protobuf/plugin/embedcheck
The embedcheck plugin is used to check whether embed is not used incorrectly.
The embedcheck plugin is used to check whether embed is not used incorrectly.
_workspace/src/github.com/gogo/protobuf/plugin/enumstringer
The enumstringer (experimental) plugin generates a String method for each enum.
The enumstringer (experimental) plugin generates a String method for each enum.
_workspace/src/github.com/gogo/protobuf/plugin/equal
The equal plugin generates an Equal and a VerboseEqual method for each message.
The equal plugin generates an Equal and a VerboseEqual method for each message.
_workspace/src/github.com/gogo/protobuf/plugin/face
The face plugin generates a function will be generated which can convert a structure which satisfies an interface (face) to the specified structure.
The face plugin generates a function will be generated which can convert a structure which satisfies an interface (face) to the specified structure.
_workspace/src/github.com/gogo/protobuf/plugin/gostring
The gostring plugin generates a GoString method for each message.
The gostring plugin generates a GoString method for each message.
_workspace/src/github.com/gogo/protobuf/plugin/marshalto
The marshalto plugin generates a Marshal and MarshalTo method for each message.
The marshalto plugin generates a Marshal and MarshalTo method for each message.
_workspace/src/github.com/gogo/protobuf/plugin/populate
The populate plugin generates a NewPopulated function.
The populate plugin generates a NewPopulated function.
_workspace/src/github.com/gogo/protobuf/plugin/size
The size plugin generates a Size method for each message.
The size plugin generates a Size method for each message.
_workspace/src/github.com/gogo/protobuf/plugin/stringer
The stringer plugin generates a String method for each message.
The stringer plugin generates a String method for each message.
_workspace/src/github.com/gogo/protobuf/plugin/testgen
The testgen plugin generates Test and Benchmark functions for each message.
The testgen plugin generates Test and Benchmark functions for each message.
_workspace/src/github.com/gogo/protobuf/plugin/union
The onlyone plugin generates code for the onlyone extension.
The onlyone plugin generates code for the onlyone extension.
_workspace/src/github.com/gogo/protobuf/plugin/unmarshal
The unmarshal plugin generates a Unmarshal method for each message.
The unmarshal plugin generates a Unmarshal method for each message.
_workspace/src/github.com/gogo/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/descriptor
Package google_protobuf is a generated protocol buffer package.
Package google_protobuf is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator
The code generator for the plugin for the Google protocol buffer compiler.
The code generator for the plugin for the Google protocol buffer compiler.
_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/plugin
Package google_protobuf_compiler is a generated protocol buffer package.
Package google_protobuf_compiler is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test
Package test is a generated protocol buffer package.
Package test is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/custom
Package custom contains custom types for test and example purposes.
Package custom contains custom types for test and example purposes.
_workspace/src/github.com/gogo/protobuf/test/custom-dash-type
Package custom contains custom types for test and example purposes.
Package custom contains custom types for test and example purposes.
_workspace/src/github.com/gogo/protobuf/test/enumprefix
Package enumprefix is a generated protocol buffer package.
Package enumprefix is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/enumstringer
Package enumstringer is a generated protocol buffer package.
Package enumstringer is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/example
Package test is a generated protocol buffer package.
Package test is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/group
Package group is a generated protocol buffer package.
Package group is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/issue34
Package issue34 is a generated protocol buffer package.
Package issue34 is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/issue8
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/moredefaults
Package moredefaults is a generated protocol buffer package.
Package moredefaults is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/packed
Package packed is a generated protocol buffer package.
Package packed is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/tags
Package tags is a generated protocol buffer package.
Package tags is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/unmarshalmerge
Package unmarshalmerge is a generated protocol buffer package.
Package unmarshalmerge is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/unrecognized
Package unrecognized is a generated protocol buffer package.
Package unrecognized is a generated protocol buffer package.
_workspace/src/github.com/gogo/protobuf/test/unrecognizedgroup
Package unrecognizedgroup is a generated protocol buffer package.
Package unrecognizedgroup is a generated protocol buffer package.
_workspace/src/github.com/gorilla/websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
Package websocket implements the WebSocket protocol defined in RFC 6455.
_workspace/src/github.com/gorilla/websocket/examples/autobahn
Command server is a test server for the Autobahn WebSockets Test Suite.
Command server is a test server for the Autobahn WebSockets Test Suite.
_workspace/src/gopkg.in/alecthomas/kingpin.v1
Package kingpin provides command line interfaces like this: $ chat usage: chat [<flags>] <command> [<flags>] [<args> ...] Flags: --debug enable debug mode --help Show help.
Package kingpin provides command line interfaces like this: $ chat usage: chat [<flags>] <command> [<flags>] [<args> ...] Flags: --debug enable debug mode --help Show help.
_workspace/src/gopkg.in/alecthomas/kingpin.v1/examples/curl
A curl-like HTTP command-line client.
A curl-like HTTP command-line client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL