Skip to content

Parse the Heroku application/logplex documents sent over HTTPS log drains and their syslog contents.

License

Notifications You must be signed in to change notification settings

keithduncan/logplex-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logplex-parse

Parse the Heroku application/logplex documents sent over HTTPS log drains and their syslog contents

Parsers

Heroku’s Logplex can be configured to send batches of logs over HTTPS. The application/logplex-1 documents use the framing scheme specified in RFC6587.

Each frame contains a syslog entry as specified in RFC5424 although Heroku forgoes encoding the structured-data nilvalue and skips straight to the message data ¯\(°_o)/¯

This module contains a parser for each format and decodes them into a LogEntry for consumption by applications.

Examples

parseLogplex "106 <10>123 2015-12-03T23:12:17+11:00 keiths-macbook-pro.local logplex-parse 420 - [foo bar=\"baz\"] error=1234595 <10>123 2015-12-03T23:12:17+11:00 keiths-macbook-pro.local logplex-parse 420 - Error R99 heroku95 <10>123 2015-12-03T23:12:17+11:00 keiths-macbook-pro.local logplex-parse 420 - Error R89 heroku95 <10>123 2015-12-03T23:12:17+11:00 keiths-macbook-pro.local logplex-parse 420 - Error L99 heroku120 <10>123 2015-12-03T23:12:17+11:00 keiths-macbook-pro.local logplex-parse 420 - at=error code=H12 desc=\"a thing happened\""

Right [
  LogEntry {getPriority = "10", getVersion = "123", getTimestamp = 2015-12-03 12:12:17 UTC, getHostname = "keiths-macbook-pro.local", getAppname = "logplex-parse", getProcessId = "420", getMessageId = "-", getStructuredData = [StructuredData {getId = "foo", getParams = [("bar","baz")]}], getMessage = Just "error=12345"},
  LogEntry {getPriority = "10", getVersion = "123", getTimestamp = 2015-12-03 12:12:17 UTC, getHostname = "keiths-macbook-pro.local", getAppname = "logplex-parse", getProcessId = "420", getMessageId = "-", getStructuredData = [], getMessage = Just "Error R99 heroku"},
  LogEntry {getPriority = "10", getVersion = "123", getTimestamp = 2015-12-03 12:12:17 UTC, getHostname = "keiths-macbook-pro.local", getAppname = "logplex-parse", getProcessId = "420", getMessageId = "-", getStructuredData = [], getMessage = Just "Error R89 heroku"},
  LogEntry {getPriority = "10", getVersion = "123", getTimestamp = 2015-12-03 12:12:17 UTC, getHostname = "keiths-macbook-pro.local", getAppname = "logplex-parse", getProcessId = "420", getMessageId = "-", getStructuredData = [], getMessage = Just "Error L99 heroku"},
  LogEntry {getPriority = "10", getVersion = "123", getTimestamp = 2015-12-03 12:12:17 UTC, getHostname = "keiths-macbook-pro.local", getAppname = "logplex-parse", getProcessId = "420", getMessageId = "-", getStructuredData = [], getMessage = Just "at=error code=H12 desc=\"a thing happened\""}
]

About

Parse the Heroku application/logplex documents sent over HTTPS log drains and their syslog contents.

Topics

Resources

License

Stars

Watchers

Forks

Packages