Git Product home page Git Product logo

blackbox's People

Contributors

acrmp avatar aminjam avatar andrew-su avatar andrewedstrom avatar anexper avatar anshrupani avatar arjun024 avatar benjamintf1 avatar christopherclark avatar ctlong avatar dependabot[bot] avatar duanemay avatar evashort avatar floriannachtigall avatar langered avatar mariash avatar natalieparellano avatar pivotalgeorge avatar rroberts2222 avatar sesmith177 avatar thomas-kaltenbach avatar vito avatar xoebus avatar zachgersh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blackbox's Issues

Log File Naming

Blackbox assumes that all your logs are ".log". In some cases that's not true. Could you add a PR to pass a logprefix as a variable from the yaml.

example yaml:
syslog:
address: 10.244.9.5
transport: tcp
blackbox:
log_prefix: ap_log

Blackbox process crashes if too many files match the configured regex

We had a bosh deployment failing due to the blackbox process crashing with error

2018/11/14 19:13:27 Seeked /var/vcap/sys/log/kube-apiserver/audit-2018-11-09T19-23-44.754.log - &{Offset:0 Whence:2}
2018/11/14 19:13:27 lines flushed; exiting tailer
2018/11/14 19:13:27 FATAL -- failed to create Watcher
goroutine 4089 [running]:
runtime/debug.Stack(0xc420012ba0, 0x21, 0x0)
        /var/vcap/data/packages/golang/d2abe6ed3ac3b89eb235e73ed653ec3a635e3d9f/src/runtime/debug/stack.go:24 +0xa7
github.com/hpcloud/tail/util.Fatal(0x6498cf, 0x18, 0x0, 0x0, 0x0)
        /var/vcap/packages/blackbox/src/github.com/hpcloud/tail/util/util.go:22 +0xc7
github.com/hpcloud/tail/watch.(*InotifyTracker).run(0xc421c26600)
        /var/vcap/packages/blackbox/src/github.com/hpcloud/tail/watch/inotify_tracker.go:231 +0x4c8
created by github.com/hpcloud/tail/watch.glob..func1
        /var/vcap/packages/blackbox/src/github.com/hpcloud/tail/watch/inotify_tracker.go:54 +0x1dd

We found that this was due to a large number of files matching the tail pattern which exceeded the number of file handles available. We now have a solution for our release where we are not creating such a large number of files.

Just wanted to ask if the behaviour above is expected?

The names of the logfiles are not passed to syslog

Current behaviour

All log files found below the configured source_dir: folder are passed to the syslog server.
The directory name below source_dir: is passed as the app-name in the syslog protocol.

tag, err := filepath.Rel(f.sourceDir, logfileDir)

The name of the log files is not passed to the syslog server!

Issue

Very often there are several different log files, with different semantics and sometimes even different format. Since the log file name is lost, it is hard the filter specific log files or use different log parsers.

Possible solution

One possible solution could be to pass the relative folder name, including the file name in the syslog app-name field.

For example:

Blackbox configuration:

syslog:
...
    source_dir: /var/vcap/sys/log/

Log files:

/var/vcap/sys/log/director/access.log
/var/vcap/sys/log/director/director.stdout.log
/var/vcap/sys/log/director/director.error.log
...

Passed app-name values

director/access.log
director/director.stdout.log
director/director.error.log
...

If the current behaviour should not change by default, the new behaviour could be configurable.

Should we create a PR?

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.