https://github.com/hartfordfive/protologbeat
Application accepting log data via TCP or UDP to then index the data in Elasticsearch
https://github.com/hartfordfive/protologbeat
elasticsearch json json-schema libbeat logging syslog tcp udp
Last synced: 19 days ago
JSON representation
Application accepting log data via TCP or UDP to then index the data in Elasticsearch
- Host: GitHub
- URL: https://github.com/hartfordfive/protologbeat
- Owner: hartfordfive
- License: other
- Created: 2017-04-14T13:04:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-18T21:15:52.000Z (about 5 years ago)
- Last Synced: 2025-03-25T21:22:25.073Z (about 1 month ago)
- Topics: elasticsearch, json, json-schema, libbeat, logging, syslog, tcp, udp
- Language: Go
- Size: 15.1 MB
- Stars: 27
- Watchers: 8
- Forks: 14
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# cleanhttp
Functions for accessing "clean" Go http.Client values
-------------
The Go standard library contains a default `http.Client` called
`http.DefaultClient`. It is a common idiom in Go code to start with
`http.DefaultClient` and tweak it as necessary, and in fact, this is
encouraged; from the `http` package documentation:> The Client's Transport typically has internal state (cached TCP connections),
so Clients should be reused instead of created as needed. Clients are safe for
concurrent use by multiple goroutines.Unfortunately, this is a shared value, and it is not uncommon for libraries to
assume that they are free to modify it at will. With enough dependencies, it
can be very easy to encounter strange problems and race conditions due to
manipulation of this shared value across libraries and goroutines (clients are
safe for concurrent use, but writing values to the client struct itself is not
protected).Making things worse is the fact that a bare `http.Client` will use a default
`http.Transport` called `http.DefaultTransport`, which is another global value
that behaves the same way. So it is not simply enough to replace
`http.DefaultClient` with `&http.Client{}`.This repository provides some simple functions to get a "clean" `http.Client`
-- one that uses the same default values as the Go standard library, but
returns a client that does not share any state with other clients.