File: README.md

package info (click to toggle)
ocaml-syslog-message 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 112 kB
  • sloc: ml: 465; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 1,076 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## syslog-message - Syslog message parser

1.2.0

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

## Documentation

[![Build Status](https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Fverbosemode%2Fsyslog-message%2Fmain&logo=ocaml)](https://ci.ocamllabs.io/github/verbosemode/syslog-message)

[API documentation](https://verbosemode.github.io/syslog-message/doc/) is available online.

```ocaml
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`