Skip to content

Commit

Permalink
packetbeat/module: fix upload of bundled ingest pipelines on Windows (#…
Browse files Browse the repository at this point in the history
…41110)

Detection of data stream identity was using os.PathSeparator which will
not match the path separator used by embed.FS which is always "/"[1].

[1]https://pkg.go.dev/embed#hdr-Directives
  • Loading branch information
efd6 authored Oct 4, 2024
1 parent 43301bc commit f55bd8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]

*Packetbeat*

- Fix upload of bundled ingest pipelines on Windows. {pull}41110[41110]

*Winlogbeat*

Expand Down
6 changes: 4 additions & 2 deletions packetbeat/module/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"encoding/json"
"errors"
"fmt"
"os"
"path"
"path/filepath"
"strings"
Expand Down Expand Up @@ -113,7 +112,10 @@ func readFile(filename string, info beat.Info) (p pipeline, err error) {
if err != nil {
return pipeline{}, err
}
ds, _, _ := strings.Cut(filename, string(os.PathSeparator))
ds, _, ok := strings.Cut(filename, "/")
if !ok {
return pipeline{}, fmt.Errorf("unexpected filename '%s': missing '/' between data stream and 'ingest'", filename)
}
p = pipeline{
id: fileset.FormatPipelineID(info.IndexPrefix, "", "", ds, info.Version),
contents: updatedContent,
Expand Down

0 comments on commit f55bd8d

Please sign in to comment.