File: example_test.go

package info (click to toggle)
golang-github-jeromer-syslogparser 0~20150717.ff71fe7a-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 188 kB
  • ctags: 343
  • sloc: makefile: 19
file content (19 lines) | stat: -rw-r--r-- 418 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
package rfc5424_test

import (
	"fmt"
	"github.com/jeromer/syslogparser/rfc5424"
)

func ExampleNewParser() {
	b := `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"] An application event log entry...`
	buff := []byte(b)

	p := rfc5424.NewParser(buff)
	err := p.Parse()
	if err != nil {
		panic(err)
	}

	fmt.Println(p.Dump())
}