Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/ci-fix-no…
Browse files Browse the repository at this point in the history
…-matches-found

* upstream/master: (21 commits)
  Skip filestream flaky tests (elastic#21490)
  Ignore unsupported metrics in the azure module (elastic#21486)
  Do not run symlink tests on Windows (elastic#21472)
  Map `cloud.account.id` to azure sub id (elastic#21483)
  Add support for app_state metricset (elastic#20639)
  Include original error when metricbeat fails to connect with Kafka (elastic#21484)
  Prompt only when agent is already enrolled (elastic#21473)
  Fix leftover delpoyment example (elastic#21474)
  Bump version to ECS 1.6 in modules without ECS updates (elastic#21455)
  Clarify input type configuration options (elastic#19284)
  Increase index pattern size check to 10MiB (elastic#21487)
  Migrate S3 Input to Filebeat Input V2 (elastic#20005)
  [libbeat] Add configurable exponential backoff for disk queue write errors (elastic#21493)
  Revert "Revert "[JJBB] Set shallow cloning to 10 (elastic#21409)" (elastic#21447)" (elastic#21467)
  Fix format of debug messages in tlscommon (elastic#21482)
  [CI] Change x-pack/auditbeat build events (comments, labels) (elastic#21463)
  [CI] changeset from elastic#20603 was not added to CI2.0 (elastic#21464)
  Add new log file reader for filestream input (elastic#21450)
  [CI] Send slack message with build status (elastic#21428)
  Remove duplicated sources url in dependencies report (elastic#21462)
  ...
  • Loading branch information
v1v committed Oct 5, 2020
2 parents 301f037 + 6fdb4ba commit ef26081
Show file tree
Hide file tree
Showing 186 changed files with 4,641 additions and 1,233 deletions.
2 changes: 1 addition & 1 deletion .ci/jobs/apm-beats-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
2 changes: 1 addition & 1 deletion .ci/jobs/beats-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
2 changes: 1 addition & 1 deletion .ci/jobs/beats-windows-mbp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
before: true
prune: true
shallow-clone: true
depth: 4
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
2 changes: 1 addition & 1 deletion .ci/jobs/beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
2 changes: 1 addition & 1 deletion .ci/jobs/golang-crossbuild-mbp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
before: true
prune: true
shallow-clone: true
depth: 4
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
2 changes: 1 addition & 1 deletion .ci/jobs/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add missing info about the rest of the azure metricsets in the documentation. {pull}19601[19601]
- Fix k8s scheduler compatibility issue. {pull}19699[19699]
- Fix SQL module mapping NULL values as string {pull}18955[18955] {issue}18898[18898
- Add support for azure light metricset app_stats. {pull}20639[20639]
- Fix ec2 disk and network metrics to use Sum statistic method. {pull}20680[20680]
- Fill cloud.account.name with accountID if account alias doesn't exist. {pull}20736[20736]
- The Kibana collector applies backoff when errored at getting usage stats {pull}20772[20772]
Expand Down Expand Up @@ -603,6 +604,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Always attempt community_id processor on zeek module {pull}21155[21155]
- Add related.hosts ecs field to all modules {pull}21160[21160]
- Keep cursor state between httpjson input restarts {pull}20751[20751]
- Convert aws s3 to v2 input {pull}20005[20005]

*Heartbeat*

Expand Down Expand Up @@ -729,6 +731,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add overview and platform health dashboards to Cloud Foundry module. {pull}21124[21124]
- Release lambda metricset in aws module as GA. {issue}21251[21251] {pull}21255[21255]
- Add dashboard for pubsub metricset in googlecloud module. {pull}21326[21326] {issue}17137[17137]
- Expand unsupported option from namespace to metrics in the azure module. {pull}21486[21486]
- Map cloud data filed `cloud.account.id` to azure subscription. {pull}21483[21483] {issue}21381[21381]

*Packetbeat*

Expand Down
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pipeline {
PIPELINE_LOG_LEVEL = 'INFO'
PYTEST_ADDOPTS = "${params.PYTEST_ADDOPTS}"
RUNBLD_DISABLE_NOTIFICATIONS = 'true'
SLACK_CHANNEL = "#beats-ci-builds"
TERRAFORM_VERSION = "0.12.24"
XPACK_MODULE_PATTERN = '^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*'
}
Expand Down Expand Up @@ -121,7 +122,7 @@ pipeline {
runbld(stashedTestReports: stashedTestReports, project: env.REPO)
}
cleanup {
notifyBuildResult(prComment: true)
notifyBuildResult(prComment: true, slackComment: true)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ changeset:
- "^\\.ci/scripts/.*"
oss:
- "^go.mod"
- "^pytest.ini"
- "^dev-tools/.*"
- "^libbeat/.*"
- "^testing/.*"
xpack:
- "^go.mod"
- "^pytest.ini"
- "^dev-tools/.*"
- "^libbeat/.*"
- "^testing/.*"
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
Name = "auditbeat"

// ecsVersion specifies the version of ECS that Auditbeat is implementing.
ecsVersion = "1.5.0"
ecsVersion = "1.6.0"
)

// RootCmd for running auditbeat.
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/dependencies-report
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ go list -m -json all $@ | go run go.elastic.co/go-licence-detector \
# name,url,version,revision,license
ubi8url='https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8'
ubi8source='https://oss-dependencies.elastic.co/redhat/ubi/ubi-minimal-8-source.tar.gz'
ubilicense='Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf,https://oss-dependencies.elastic.co/redhat/ubi/ubi-minimal-8-source.tar.gz'
ubilicense='Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf'
cat <<EOF >> $outfile
Red Hat Universal Base Image,$ubi8url,8,,$ubilicense,$ubi8source
EOF
8 changes: 5 additions & 3 deletions filebeat/docs/reload-configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ definitions.

TIP: The first line of each external configuration file must be an input
definition that starts with `- type`. Make sure you omit the line
+{beatname_lc}.config.inputs+ from this file.

For example:
+{beatname_lc}.config.inputs+ from this file. All <<filebeat-input-types,`input type configuration options`>>
must be specified within each external configuration file. Specifying these
configuration options at the global `filebeat.config.inputs` level is not supported.

Example external configuration file:

[source,yaml]
------------------------------------------------------------------------------
Expand Down
147 changes: 147 additions & 0 deletions filebeat/input/filestream/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
// 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 filestream

import (
"fmt"
"time"

"github.com/dustin/go-humanize"

"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common/match"
"github.com/elastic/beats/v7/libbeat/reader/readfile"
)

// Config stores the options of a file stream.
type config struct {
Paths []string `config:"paths"`
Close closerConfig `config:"close"`
FileWatcher *common.ConfigNamespace `config:"file_watcher"`
Reader readerConfig `config:"readers"`
FileIdentity *common.ConfigNamespace `config:"file_identity"`
CleanInactive time.Duration `config:"clean_inactive" validate:"min=0"`
CleanRemoved bool `config:"clean_removed"`
HarvesterLimit uint32 `config:"harvester_limit" validate:"min=0"`
IgnoreOlder time.Duration `config:"ignore_older"`
}

type closerConfig struct {
OnStateChange stateChangeCloserConfig `config:"on_state_change"`
Reader readerCloserConfig `config:"reader"`
}

type readerCloserConfig struct {
AfterInterval time.Duration
Inactive time.Duration
OnEOF bool
}

type stateChangeCloserConfig struct {
CheckInterval time.Duration
Removed bool
Renamed bool
}

// TODO should this be inline?
type readerConfig struct {
Backoff backoffConfig `config:"backoff"`
BufferSize int `config:"buffer_size"`
Encoding string `config:"encoding"`
ExcludeLines []match.Matcher `config:"exclude_lines"`
IncludeLines []match.Matcher `config:"include_lines"`
LineTerminator readfile.LineTerminator `config:"line_terminator"`
MaxBytes int `config:"message_max_bytes" validate:"min=0,nonzero"`
Tail bool `config:"seek_to_tail"`

Parsers []*common.ConfigNamespace `config:"parsers"` // TODO multiline, json, syslog?
}

type backoffConfig struct {
Init time.Duration `config:"init" validate:"nonzero"`
Max time.Duration `config:"max" validate:"nonzero"`
}

func defaultConfig() config {
return config{
Paths: []string{},
Close: defaultCloserConfig(),
Reader: defaultReaderConfig(),
CleanInactive: 0,
CleanRemoved: true,
HarvesterLimit: 0,
IgnoreOlder: 0,
}
}

func defaultCloserConfig() closerConfig {
return closerConfig{
OnStateChange: stateChangeCloserConfig{
CheckInterval: 5 * time.Second,
Removed: true, // TODO check clean_removed option
Renamed: false,
},
Reader: readerCloserConfig{
OnEOF: false,
Inactive: 0 * time.Second,
AfterInterval: 0 * time.Second,
},
}
}

func defaultReaderConfig() readerConfig {
return readerConfig{
Backoff: backoffConfig{
Init: 1 * time.Second,
Max: 10 * time.Second,
},
BufferSize: 16 * humanize.KiByte,
LineTerminator: readfile.AutoLineTerminator,
MaxBytes: 10 * humanize.MiByte,
Tail: false,
Parsers: nil,
}
}

func (c *config) Validate() error {
if len(c.Paths) == 0 {
return fmt.Errorf("no path is configured")
}
// TODO
//if c.CleanInactive != 0 && c.IgnoreOlder == 0 {
// return fmt.Errorf("ignore_older must be enabled when clean_inactive is used")
//}

// TODO
//if c.CleanInactive != 0 && c.CleanInactive <= c.IgnoreOlder+c.ScanFrequency {
// return fmt.Errorf("clean_inactive must be > ignore_older + scan_frequency to make sure only files which are not monitored anymore are removed")
//}

// TODO
//if c.JSON != nil && len(c.JSON.MessageKey) == 0 &&
// c.Multiline != nil {
// return fmt.Errorf("When using the JSON decoder and multiline together, you need to specify a message_key value")
//}

//if c.JSON != nil && len(c.JSON.MessageKey) == 0 &&
// (len(c.IncludeLines) > 0 || len(c.ExcludeLines) > 0) {
// return fmt.Errorf("When using the JSON decoder and line filtering together, you need to specify a message_key value")
//}

return nil
}
Loading

0 comments on commit ef26081

Please sign in to comment.