-
Notifications
You must be signed in to change notification settings - Fork 5k
Add multiline support to awss3 input #25710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
e2cf26d
d90b4b7
8558f49
423cf7d
85c7985
da10563
8a3b408
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,25 +9,38 @@ import ( | |
| "regexp" | ||
| "time" | ||
|
|
||
| "github.com/dustin/go-humanize" | ||
| "github.com/elastic/beats/v7/libbeat/reader/multiline" | ||
| "github.com/elastic/beats/v7/libbeat/reader/readfile" | ||
| awscommon "github.com/elastic/beats/v7/x-pack/libbeat/common/aws" | ||
| ) | ||
|
|
||
| type config struct { | ||
| APITimeout time.Duration `config:"api_timeout"` | ||
| ExpandEventListFromField string `config:"expand_event_list_from_field"` | ||
| FileSelectors []FileSelectorCfg `config:"file_selectors"` | ||
| FipsEnabled bool `config:"fips_enabled"` | ||
| MaxNumberOfMessages int `config:"max_number_of_messages"` | ||
| QueueURL string `config:"queue_url" validate:"nonzero,required"` | ||
| VisibilityTimeout time.Duration `config:"visibility_timeout"` | ||
| AwsConfig awscommon.ConfigAWS `config:",inline"` | ||
| APITimeout time.Duration `config:"api_timeout"` | ||
| ExpandEventListFromField string `config:"expand_event_list_from_field"` | ||
| FileSelectors []FileSelectorCfg `config:"file_selectors"` | ||
| FipsEnabled bool `config:"fips_enabled"` | ||
| MaxNumberOfMessages int `config:"max_number_of_messages"` | ||
| QueueURL string `config:"queue_url" validate:"nonzero,required"` | ||
| VisibilityTimeout time.Duration `config:"visibility_timeout"` | ||
| AwsConfig awscommon.ConfigAWS `config:",inline"` | ||
| MaxBytes int `config:"max_bytes" validate:"min=0,nonzero"` | ||
| Multiline *multiline.Config `config:"multiline"` | ||
|
||
| LineTerminator readfile.LineTerminator `config:"line_terminator"` | ||
| Encoding string `config:"encoding"` | ||
| BufferSize int `config:"buffer_size"` | ||
| } | ||
|
|
||
| // FileSelectorCfg defines type and configuration of FileSelectors | ||
| type FileSelectorCfg struct { | ||
| RegexString string `config:"regex"` | ||
| Regex *regexp.Regexp `config:",ignore"` | ||
| ExpandEventListFromField string `config:"expand_event_list_from_field"` | ||
| RegexString string `config:"regex"` | ||
| Regex *regexp.Regexp `config:",ignore"` | ||
| ExpandEventListFromField string `config:"expand_event_list_from_field"` | ||
| MaxBytes int `config:"max_bytes" validate:"min=0,nonzero"` | ||
| Multiline *multiline.Config `config:"multiline"` | ||
| LineTerminator readfile.LineTerminator `config:"line_terminator"` | ||
| Encoding string `config:"encoding"` | ||
| BufferSize int `config:"buffer_size"` | ||
| } | ||
|
|
||
| func defaultConfig() config { | ||
|
|
@@ -36,6 +49,9 @@ func defaultConfig() config { | |
| FipsEnabled: false, | ||
| MaxNumberOfMessages: 5, | ||
| VisibilityTimeout: 300 * time.Second, | ||
| LineTerminator: readfile.AutoLineTerminator, | ||
| MaxBytes: 10 * humanize.MiByte, | ||
| BufferSize: 16 * humanize.KiByte, | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <Event><Data> | ||
| A | ||
| B | ||
| C</Data></Event> | ||
| <Event><Data> | ||
| D | ||
| E | ||
| F</Data</Event> |
Uh oh!
There was an error while loading. Please reload this page.