package syslog-message

  1. Overview
  2. Docs
Syslog message parser

Install

Dune Dependency

Authors

Maintainers

Sources

syslog-message-1.2.0.tbz
sha256=f9eca2bfa26f0b410ab371b5b39aa816d2b46d4e18838d401e0e4d73ac43f70d
sha512=7bcf7d6b8085614a440c67a655c90353f56a55a7e0888fc9a1e7b7dec7a84bb32d36324fd157fd70942b0d868cc85e19272e7700ccc68362e15b5d4b6df66993

README.md.html

syslog-message - Syslog message parser

1.2.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.