Skip to content

Commit

Permalink
Using strings.TrimRight
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansr committed Mar 26, 2020
1 parent 88bc1fe commit d9c9fc0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 41 deletions.
4 changes: 4 additions & 0 deletions x-pack/filebeat/processors/decode_cef/cef/cef.rl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package cef
import (
"fmt"
"strconv"
"strings"

"go.uber.org/multierr"
)
Expand All @@ -17,6 +18,9 @@ import (

// unpack unpacks a CEF message.
func (e *Event) unpack(data string) error {
const ws = " \r\n\t\v\f"
data = strings.TrimRight(data, ws)

cs, p, pe, eof := 0, 0, len(data), len(data)
mark := 0

Expand Down
90 changes: 49 additions & 41 deletions x-pack/filebeat/processors/decode_cef/cef/parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d9c9fc0

Please sign in to comment.