Documentation ¶
Index ¶
- Variables
- func BodyToResource(body []byte) (*logging.Resource, error)
- func EncodeString(s string, charactersToEncode string) string
- func ProcessMessage(rfcLogMessage syslog.Message) (*logging.Resource, error)
- func RFC5424QueueName() string
- func RabbitMQRFC5424Worker(resourceChannel chan<- logging.Resource, done <-chan bool) rabbitmq.ConsumerHandlerFunc
- type Channel
- type DHPLogData
- type DHPLogMessage
- type Deliverer
- type Logger
- type Queue
- type RabbitMQ
Constants ¶
This section is empty.
Variables ¶
var ( Exchange = "logproxy" RoutingKey = "new.rfc5424" ErrInvalidProducer = errors.New("RabbitMQ producer is nil or invalid") )
Functions ¶
func EncodeString ¶
EncodeString encodes all characters from the characterstoEncode set
func ProcessMessage ¶
func RFC5424QueueName ¶
func RFC5424QueueName() string
RFC5424QueueName returns the queue name to use
func RabbitMQRFC5424Worker ¶
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel implements a Queue based on a go channel
func NewChannelQueue ¶
type DHPLogData ¶
type DHPLogData struct {
Message string `json:"message"`
}
DHPLogData represents the payload of DHPLogMessage
type DHPLogMessage ¶
type DHPLogMessage struct { Category string `json:"cat"` EventID string `json:"evt"` ApplicationVersion string `json:"ver"` Component string `json:"cmp"` ApplicationName string `json:"app"` ApplicationInstance string `json:"inst"` ServerName string `json:"srv"` TransactionID string `json:"trns"` ServiceName string `json:"service"` LogTime string `json:"time"` OriginatingUser string `json:"usr"` Severity string `json:"sev"` LogData DHPLogData `json:"val"` Custom json.RawMessage `json:"custom,omitempty"` }
DHPLogMessage describes a structured log message from applications
type Deliverer ¶
type Deliverer struct { Debug bool // contains filtered or unexported fields }
Deliverer implements all processing logic for parsing and forwarding logs
func NewDeliverer ¶
func NewDeliverer(storer logging.Storer, log Logger, manager *shared.PluginManager, buildVersion string) (*Deliverer, error)
NewDeliverer returns a new configured Deliverer instance
func (*Deliverer) ResourceWorker ¶
ResourceWorker implements the worker process for parsing the queues
type Logger ¶
type Logger interface {
Debugf(format string, args ...interface{})
}
Logger implements logging interface
type Queue ¶
type Queue interface { // Start initializes the and returns a stop channel Start() (chan bool, error) // Output should return a channel fed by the queue raw data Output() <-chan logging.Resource // Push should queue the raw payload Push([]byte) error // DeadLetter should store a rejected logging.Resource for later processing DeadLetter(msg logging.Resource) error }
Queue implements a queue mechanism. The queue can be backed by e.g. RabbitMQ or a simple Go channel. Both of these are provided as part of logproxy. Internally the queue is driven by the Deliverer which transforms the raw payload to a logging.Resource and than pushes it to HSDP logging infrastructure
type RabbitMQ ¶
type RabbitMQ struct {
// contains filtered or unexported fields
}
RabbitMQ implements Queue backed by RabbitMQ