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
c0982269
Commit
c0982269
authored
Jul 02, 2013
by
Jordan Sissel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- add 'host' field
parent
d38a10ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
publisher1.go
publisher1.go
+2
-2
No files found.
publisher1.go
View file @
c0982269
...
...
@@ -20,7 +20,6 @@ var hostname string
func
init
()
{
log
.
Printf
(
"publisher init
\n
"
)
hostname
,
_
=
os
.
Hostname
()
}
func
Publishv1
(
input
chan
[]
*
FileEvent
,
...
...
@@ -168,9 +167,10 @@ func writeDataFrame(event *FileEvent, sequence uint32, output io.Writer) {
// sequence number
binary
.
Write
(
output
,
binary
.
BigEndian
,
uint32
(
sequence
))
// 'pair' count
binary
.
Write
(
output
,
binary
.
BigEndian
,
uint32
(
len
(
*
event
.
Fields
)
+
3
))
binary
.
Write
(
output
,
binary
.
BigEndian
,
uint32
(
len
(
*
event
.
Fields
)
+
4
))
writeKV
(
"file"
,
*
event
.
Source
,
output
)
writeKV
(
"host"
,
hostname
,
output
)
writeKV
(
"offset"
,
strconv
.
FormatInt
(
event
.
Offset
,
10
),
output
)
writeKV
(
"line"
,
*
event
.
Text
,
output
)
for
k
,
v
:=
range
(
*
event
.
Fields
)
{
...
...
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