Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/vendor/github.com/heroku/x/logplex/encoding
Pablo 0e28452f1f
Targets: Add Heroku HTTPS drain target (#6448)
4 years ago
..
README.md Targets: Add Heroku HTTPS drain target (#6448) 4 years ago
encoder.go Targets: Add Heroku HTTPS drain target (#6448) 4 years ago
message.go Targets: Add Heroku HTTPS drain target (#6448) 4 years ago
parser.go Targets: Add Heroku HTTPS drain target (#6448) 4 years ago
scanner.go Targets: Add Heroku HTTPS drain target (#6448) 4 years ago

README.md

logplex/encoding

What's this?

A set of libraries we use to parse messages, and to also publish these same syslog RFC5424 messages.

How to use?

We have 2 scanners available. If you're trying to build a logplex compatible ingress, you can use the regular scanner.

Scanner

func handler(w http.ResponseWriter, r *http.Request) {
	s := NewScanner(r.Body)

	for s.Scan() {
		log.Printf("%+v", scanner.Message())
	}

	if s.Err() != nil {
		log.Printf("err: %v", s.Err())
	}
}

DrainScanner

If the intent is to write an application which acts as a heroku drain, then using the DrainScanner is preferrable -- primarily because it doesn't require structured data.

func handler(w http.ResponseWriter, r *http.Request) {
	s := NewDrainScanner(r.Body)

	for s.Scan() {
		log.Printf("%+v", scanner.Message())
	}

	if s.Err() != nil {
		log.Printf("err: %v", s.Err())
	}
}