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) (#41116)

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

(cherry picked from commit f55bd8d)

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
  • Loading branch information
mergify[bot] and efd6 authored Oct 4, 2024
1 parent 3ab084a commit 8f62854
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 @@ -207,6 +207,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 8f62854

Please sign in to comment.