Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
logstash-forwarder
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
LaaS
logstash-forwarder
Commits
48efc23b
Commit
48efc23b
authored
Apr 05, 2013
by
Jordan Sissel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
purge proto/msgpack; use json
parent
89ea13c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
src/liblumberjack/event.go
src/liblumberjack/event.go
+2
-2
src/liblumberjack/harvester.go
src/liblumberjack/harvester.go
+3
-4
src/liblumberjack/publisher.go
src/liblumberjack/publisher.go
+3
-3
No files found.
src/liblumberjack/event.go
View file @
48efc23b
...
...
@@ -2,7 +2,7 @@ package liblumberjack
type
FileEvent
struct
{
Source
*
string
`json:"source,omitempty"`
Offset
*
uint64
`json:"offset,omitempty"`
Line
*
uint64
`json:"line,omitempty"`
Offset
uint64
`json:"offset,omitempty"`
Line
uint64
`json:"line,omitempty"`
Text
*
string
`json:"text,omitempty"`
}
src/liblumberjack/harvester.go
View file @
48efc23b
...
...
@@ -6,7 +6,6 @@ import (
"bytes"
"io"
"bufio"
proto
"code.google.com/p/goprotobuf/proto"
"time"
)
...
...
@@ -65,9 +64,9 @@ func (h *Harvester) Harvest(output chan *FileEvent) {
line
++
event
:=
&
FileEvent
{
Source
:
proto
.
String
(
h
.
Path
)
,
Offset
:
proto
.
Uint64
(
uint64
(
offset
)
),
Line
:
proto
.
Uint64
(
line
)
,
Source
:
&
h
.
Path
,
Offset
:
uint64
(
offset
),
Line
:
line
,
Text
:
text
,
}
offset
+=
int64
(
len
(
*
event
.
Text
))
+
1
// +1 because of the line terminator
...
...
src/liblumberjack/publisher.go
View file @
48efc23b
...
...
@@ -2,7 +2,7 @@ package liblumberjack
import
(
"log"
msgpack
"github.com/ugorji/go-msgpack
"
"encoding/json
"
zmq
"github.com/alecthomas/gozmq"
"math/big"
"syscall"
...
...
@@ -171,10 +171,10 @@ func Publish(input chan []*FileEvent, server_list []string,
log
.
Printf
(
"Spooler gave me %d events
\n
"
,
len
(
events
))
// Serialize with msgpack
data
,
err
:=
msgpack
.
Marshal
(
events
)
data
,
err
:=
json
.
Marshal
(
events
)
// TODO(sissel): chefk error
_
=
err
//log.Printf("
msgpack
serialized %d bytes\n", len(data))
//log.Printf("
json
serialized %d bytes\n", len(data))
// Compress it
// A new compressor is used for every payload of events so
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment