Skip to content

Commit

Permalink
Fix adding of missing ID
Browse files Browse the repository at this point in the history
Fixes: #150
  • Loading branch information
breml committed Dec 14, 2021
1 parent 69c0af2 commit 5ee6436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/daemon/logstashconfig/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (v *validator) walk(c *astutil.Cursor) {
if err != nil {
if v.addMissingID {
plugin := c.Plugin()
id = fmt.Sprintf("%s-%d", name, v.count)
id = fmt.Sprintf("id_missing_%0000d", v.count)
plugin.Attributes = append(plugin.Attributes, ast.NewStringAttribute("id", id, ast.DoubleQuoted))

c.Replace(plugin)
Expand Down
2 changes: 1 addition & 1 deletion internal/daemon/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (a Archive) ZipWithPreprocessor(addMissingID bool, preprocess func([]byte)
outputs[id] += count
}

_, err = f.Write(body)
_, err = f.Write(configFile.Body)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 5ee6436

Please sign in to comment.