Skip to content

Commit 27e7561

Browse files
committed
minor fixes
1 parent a7a2243 commit 27e7561

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

filebeat/input/filestream/identifier_inode_deviceid.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828

2929
loginp "github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile"
3030
"github.com/elastic/beats/v7/libbeat/common"
31+
"github.com/elastic/beats/v7/libbeat/common/file"
3132
"github.com/elastic/beats/v7/libbeat/logp"
3233
)
3334

@@ -92,11 +93,12 @@ func (i *inodeMarkerIdentifier) markerContents() string {
9293
}
9394

9495
func (i *inodeMarkerIdentifier) GetSource(e loginp.FSEvent) fileSource {
96+
osstate := file.GetOSState(e.Info)
9597
return fileSource{
9698
info: e.Info,
9799
newPath: e.NewPath,
98100
oldPath: e.OldPath,
99-
name: fmt.Sprintf("%s%s%s-%s", i.name, identitySep, s.FileStateOS.InodeString(), i.markerContents()),
101+
name: fmt.Sprintf("%s%s%s-%s", i.name, identitySep, osstate.InodeString(), i.markerContents()),
100102
identifierGenerator: i.name,
101103
}
102104
}

filebeat/input/filestream/prospector.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ func (p *fileProspector) Run(ctx input.Context, s *statestore.Store, hg *loginp.
111111
}
112112
}
113113

114-
p.startReading(ctx, hg, src, fe.NewPath)
114+
hg.Run(ctx, src)
115115

116116
case loginp.OpWrite:
117117
log.Debugf("File %s has been updated", fe.NewPath)
118118

119-
p.startReading(ctx, hg, src, fe.NewPath)
119+
hg.Run(ctx, src)
120120

121121
case loginp.OpDelete:
122122
log.Debugf("File %s has been removed", fe.OldPath)
@@ -141,11 +141,6 @@ func (p *fileProspector) Run(ctx input.Context, s *statestore.Store, hg *loginp.
141141
return nil
142142
})
143143

144-
tg.Go(func() error {
145-
p.monitor.run(ctx.Cancelation, hg)
146-
return nil
147-
})
148-
149144
errs := tg.Wait()
150145
if len(errs) > 0 {
151146
log.Error("%s", sderr.WrapAll(errs, "running prospector failed"))

0 commit comments

Comments
 (0)