Skip to content

Commit

Permalink
Merge branch 'main' into updatecli_bump-golang-version
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacknz authored Dec 11, 2023
2 parents 83ea554 + 157b31a commit 5a13a30
Show file tree
Hide file tree
Showing 38 changed files with 333 additions and 178 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ Setting environmental variable ELASTIC_NETINFO:false in Elastic Agent pod will d

- Make ingest pipeline routing robust to letter case of channel names for forwarded events. {issue}36670[36670] {pull}36899[36899]
- Document minimum permissions required for local user account. {issue}15773[15773] {pull}37176[37176]
- Bump Windows Npcap version to v1.78. {issue}37300[37300] {pull}37370[37370]

*Functionbeat*

Expand Down
16 changes: 8 additions & 8 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13026,11 +13026,11 @@ these terms.

--------------------------------------------------------------------------------
Dependency : github.com/elastic/elastic-agent-system-metrics
Version: v0.9.0
Version: v0.9.1
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.9.0/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.9.1/LICENSE.txt:

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -14543,11 +14543,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-seccomp-bpf
Version: v1.3.0
Version: v1.4.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/go-seccomp-bpf@v1.3.0/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-seccomp-bpf@v1.4.0/LICENSE.txt:


Apache License
Expand Down Expand Up @@ -14966,11 +14966,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-structform@v

--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-sysinfo
Version: v1.11.1
Version: v1.11.2
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/go-sysinfo@v1.11.1/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-sysinfo@v1.11.2/LICENSE.txt:


Apache License
Expand Down Expand Up @@ -23317,11 +23317,11 @@ Contents of probable licence file $GOMODCACHE/github.com/xdg/scram@v1.0.3/LICENS

--------------------------------------------------------------------------------
Dependency : go.elastic.co/apm/module/apmelasticsearch/v2
Version: v2.4.4
Version: v2.4.7
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmelasticsearch/v2@v2.4.4/LICENSE:
Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmelasticsearch/v2@v2.4.7/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down
3 changes: 2 additions & 1 deletion filebeat/input/filestream/copytruncate_prospector.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

loginp "github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile"
input "github.com/elastic/beats/v7/filebeat/input/v2"
"github.com/elastic/beats/v7/libbeat/common/file"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/go-concert/unison"
)
Expand Down Expand Up @@ -330,7 +331,7 @@ func (p *copyTruncateFileProspector) onRotatedFile(
return
}
descCopy := fe.Descriptor
descCopy.Info = fi
descCopy.Info = file.ExtendFileInfo(fi)
originalSrc := p.identifier.GetSource(loginp.FSEvent{NewPath: originalPath, Descriptor: descCopy})
p.rotatedFiles.addOriginalFile(originalPath, originalSrc)
p.rotatedFiles.addRotatedFile(originalPath, fe.NewPath, src)
Expand Down
9 changes: 8 additions & 1 deletion filebeat/input/filestream/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
v2 "github.com/elastic/beats/v7/filebeat/input/v2"
"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/common/acker"
"github.com/elastic/beats/v7/libbeat/common/file"
"github.com/elastic/beats/v7/libbeat/common/transform/typeconv"
"github.com/elastic/beats/v7/libbeat/statestore"
"github.com/elastic/beats/v7/libbeat/statestore/storetest"
Expand Down Expand Up @@ -372,7 +373,13 @@ func (e *inputTestingEnvironment) getRegistryState(key string) (registryEntry, e

func getIDFromPath(filepath, inputID string, fi os.FileInfo) string {
identifier, _ := newINodeDeviceIdentifier(nil)
src := identifier.GetSource(loginp.FSEvent{Descriptor: loginp.FileDescriptor{Info: fi}, Op: loginp.OpCreate, NewPath: filepath})
src := identifier.GetSource(loginp.FSEvent{
Descriptor: loginp.FileDescriptor{
Info: file.ExtendFileInfo(fi),
},
Op: loginp.OpCreate,
NewPath: filepath,
})
return "filestream::" + inputID + "::" + src.Name()
}

Expand Down
9 changes: 6 additions & 3 deletions filebeat/input/filestream/fswatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (

"github.com/elastic/beats/v7/filebeat/input/file"
loginp "github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile"
commonfile "github.com/elastic/beats/v7/libbeat/common/file"
"github.com/elastic/beats/v7/libbeat/common/match"
conf "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/logp"
Expand Down Expand Up @@ -406,7 +407,7 @@ type ingestTarget struct {
filename string
originalFilename string
symlink bool
info os.FileInfo
info commonfile.ExtendedFileInfo
}

func (s *fileScanner) getIngestTarget(filename string) (it ingestTarget, err error) {
Expand All @@ -421,10 +422,11 @@ func (s *fileScanner) getIngestTarget(filename string) (it ingestTarget, err err
it.filename = filename
it.originalFilename = filename

it.info, err = os.Lstat(it.filename) // to determine if it's a symlink
info, err := os.Lstat(it.filename) // to determine if it's a symlink
if err != nil {
return it, fmt.Errorf("failed to lstat %q: %w", it.filename, err)
}
it.info = commonfile.ExtendFileInfo(info)

if it.info.IsDir() {
return it, fmt.Errorf("file %q is a directory", it.filename)
Expand All @@ -438,10 +440,11 @@ func (s *fileScanner) getIngestTarget(filename string) (it ingestTarget, err err
}

// now we know it's a symlink, we stat with link resolution
it.info, err = os.Stat(it.filename)
info, err := os.Stat(it.filename)
if err != nil {
return it, fmt.Errorf("failed to stat the symlink %q: %w", it.filename, err)
}
it.info = commonfile.ExtendFileInfo(info)

it.originalFilename, err = filepath.EvalSymlinks(it.filename)
if err != nil {
Expand Down
Loading

0 comments on commit 5a13a30

Please sign in to comment.