-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
55 lines (44 loc) · 1.12 KB
/
main.go
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
import "context"
func main() {
filepaths := []string{
"test-data/**.journal",
}
// filename := "test-data/user-1000.journal"
// cursor := "s=69e0bc24292040569344cea3ad97204c;i=810;b=6b84ae3ed1114c0b900c8c464e64a015;m=155e8d7;t=616c4f6c535b6;x=23a3cd7d2742e8c3"
// reader, err := newReader(filename)
units := []string{
"session-12.scope",
}
filter := Filter{
Name: "_SYSTEMD_UNIT",
Keep: true,
Matches: units,
}
filterChain := FilterChain{
OperatorOr: true,
FilterChains: []FilterChain{},
Filters: []Filter{filter},
}
// if err != nil {
// panic(err)
// }
directoryReader := newDirectoryReader()
go directoryReader.monitor(context.Background(), filepaths)
directoryReader.read(filterChain)
// err = reader.goToCursor(cursor)
// if err != nil {
// panic(err)
// }
// go reader.readAll(context.Background())
// for log := range reader.data {
// if !filterChain.filterIn(log.attributes) {
// fmt.Printf("Rejecting \n\n")
// continue
// }
// fmt.Printf("\n\n")
// for key, value := range log.attributes {
// fmt.Printf("%v=%v\n", key, value)
// }
// }
}