-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Filebeat] Unix stream socket input source (#17492)
* initial common refactor * Fix up unix and add license info * Fix inputs * Clean up handlers * Update changelog and docs * Fix added input * Fix tests * Add unix socket system tests * add systems tests for syslog unix input * pep autoformat * Disable unix tests for Windows since Python 3.8 doesn't support AF_UNIX * pep autoformat * Address feedback * fix test
- Loading branch information
Andrew Stucki
authored
Apr 21, 2020
1 parent
036bb98
commit 3b99438
Showing
27 changed files
with
1,235 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
////////////////////////////////////////////////////////////////////////// | ||
//// This content is shared by Filebeat inputs that use the Unix inputsource | ||
//// If you add IDs to sections, make sure you use attributes to create | ||
//// unique IDs for each input that includes this file. Use the format: | ||
//// [id="{beatname_lc}-input-{type}-option-name"] | ||
////////////////////////////////////////////////////////////////////////// | ||
[float] | ||
[id="{beatname_lc}-input-{type}-unix-max-message-size"] | ||
==== `max_message_size` | ||
|
||
The maximum size of the message received over the socket. The default is `20MiB`. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-unix-path"] | ||
==== `path` | ||
|
||
The path to the Unix socket that will receive event streams. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-unix-line-delimiter"] | ||
==== `line_delimiter` | ||
|
||
Specify the characters used to split the incoming events. The default is '\n'. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-unix-max-connections"] | ||
==== `max_connections` | ||
|
||
The at most number of connections to accept at any given point in time. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-unix-timeout"] | ||
==== `timeout` | ||
|
||
The number of seconds of inactivity before a connection is closed. The default is `300s`. | ||
|
||
See <<configuration-ssl>> for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package unix | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/dustin/go-humanize" | ||
|
||
"github.com/elastic/beats/v7/filebeat/harvester" | ||
"github.com/elastic/beats/v7/filebeat/inputsource/unix" | ||
) | ||
|
||
type config struct { | ||
unix.Config `config:",inline"` | ||
harvester.ForwarderConfig `config:",inline"` | ||
|
||
LineDelimiter string `config:"line_delimiter" validate:"nonzero"` | ||
} | ||
|
||
var defaultConfig = config{ | ||
ForwarderConfig: harvester.ForwarderConfig{ | ||
Type: "unix", | ||
}, | ||
Config: unix.Config{ | ||
Timeout: time.Minute * 5, | ||
MaxMessageSize: 20 * humanize.MiByte, | ||
}, | ||
LineDelimiter: "\n", | ||
} |
Oops, something went wrong.