package syslog-message

  1. Overview
  2. Docs
Syslog message parser

Install

Dune Dependency

Authors

Maintainers

Sources

syslog-message-1.1.0.tbz
sha256=6f14705026aced72a7f86548d3b0ab3ead9013f3726be77f36ca092ce86cc46f
sha512=086c80acfac751efb7dcc9d8dd078cc2c38812bfcb4a0e06ae6bf1a74189d36ec130b412738cb00d12cbdb5ffdb39f4afaa12c557ed043f2b538de628c292351

README.md.html

syslog-message - Syslog message parser

1.1.0

This is a library for parsing and generating RFC 3164 compatible Syslog messages.

Documentation

API documentation is available online.

match Ptime.of_date_time ((1970, 1, 1), ((0, 0, 0), 0)) with
| Some ts -> Syslog_message.decode ~ctx:{timestamp=ts; hostname="-"; set_hostname=false} "<133>Oct  3 15:51:21 server001: foobar"
| None -> failwith "Failed to parse Syslog message";;
- : Syslog_message.t option =
Some {Syslog_message.facility = Syslog_message.Local0; severity = Syslog_message.Notice; timestamp = <abstr>;
  hostname = "server001"; message = "foobar"}

Installation

This library can be installed with opam: opam install syslog-message

Testing

A test suite using qcheck is provided: opam install --build-test syslog-message

OCaml

Innovation. Community. Security.