diff --git a/.go-version b/.go-version index e54f3135a7de..663b0d0de025 100644 --- a/.go-version +++ b/.go-version @@ -1 +1,5 @@ +<<<<<<< HEAD 1.19.12 +======= +1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) diff --git a/.golangci.yml b/.golangci.yml index 845d95593c47..cfa2e41ab791 100755 --- a/.golangci.yml +++ b/.golangci.yml @@ -102,7 +102,11 @@ linters-settings: gosimple: # Select the Go version to target. The default is '1.13'. +<<<<<<< HEAD go: "1.19.12" +======= + go: "1.20.6" +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) nakedret: # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 @@ -120,19 +124,31 @@ linters-settings: staticcheck: # Select the Go version to target. The default is '1.13'. +<<<<<<< HEAD go: "1.19.12" +======= + go: "1.20.6" +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) checks: ["all"] stylecheck: # Select the Go version to target. The default is '1.13'. +<<<<<<< HEAD go: "1.19.12" +======= + go: "1.20.6" +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) # Disabled: # ST1005: error strings should not be capitalized checks: ["all", "-ST1005"] unused: # Select the Go version to target. The default is '1.13'. +<<<<<<< HEAD go: "1.19.12" +======= + go: "1.20.6" +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) gosec: excludes: @@ -141,3 +157,20 @@ linters-settings: - G401 # Detect the usage of DES, RC4, MD5 or SHA1: Used in non-crypto contexts. - G501 # Import blocklist: crypto/md5: Used in non-crypto contexts. - G505 # Import blocklist: crypto/sha1: Used in non-crypto contexts. +<<<<<<< HEAD +======= + + prealloc: + # IMPORTANT: we don't recommend using this linter before doing performance profiling. + # For most programs usage of prealloc will be a premature optimization. + + # Report pre-allocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. + # Default: true + simple: false + # Report pre-allocation suggestions on range loops. + # Default: true + range-loops: true + # Report pre-allocation suggestions on for loops. + # Default: false + for-loops: true +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 4362127e564e..791d7aadc9c5 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -9,7 +9,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d ==== Breaking changes *Affecting all Beats* - +- Fix status reporting to Elastic-Agent when output configuration is invalid running under Elastic-Agent {pull}35719[35719] +- Upgrade Go to 1.20.6 {pull}36000[36000] *Auditbeat* diff --git a/Vagrantfile b/Vagrantfile index 057e9044bca5..686946019938 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -320,6 +320,7 @@ Vagrant.configure("2") do |config| c.vm.provision "shell", inline: $unixProvision, privileged: false end +<<<<<<< HEAD config.vm.define "archlinux", autostart: false do |c| c.vm.box = "archlinux/archlinux" c.vm.network :forwarded_port, guest: 22, host: 2239, id: "ssh", auto_correct: true @@ -328,4 +329,50 @@ Vagrant.configure("2") do |config| c.vm.provision "shell", inline: linuxGvmProvision, privileged: false c.vm.provision "shell", inline: "pacman -Sy && pacman -S --noconfirm make gcc python python-pip git" end +======= + config.vm.define "beats" do |nodeconfig| + nodeconfig.vm.box = "ubuntu/jammy64" + + # We deliberately set a fully-qualified domain name for the VM; it helps + # test the FQDN feature flag. + nodeconfig.vm.hostname = "beats-dev.elastic.dev.internal" + + nodeconfig.vm.network "private_network", + hostname: true, + ip: "192.168.56.44" # only 192.168.56.0/21 range allowed: https://www.virtualbox.org/manual/ch06.html#network_hostonly + nodeconfig.vm.network "forwarded_port", + guest: 4244, + host: 4244, + id: "delve" + + nodeconfig.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = false + vb.customize ["modifyvm", :id, "--vram", "128"] + # Customize the amount of memory on the VM: + vb.memory = "4096" + end + + nodeconfig.vm.provision "shell", inline: <<-SHELL + apt-get update + apt-get install -y \ + build-essential \ + curl \ + delve \ + make \ + unzip + vim \ + wget + curl -sL -o /tmp/go#{GO_VERSION}.linux-amd64.tar.gz https://go.dev/dl/go#{GO_VERSION}.linux-amd64.tar.gz + tar -C /usr/local -xzf /tmp/go#{GO_VERSION}.linux-amd64.tar.gz + curl -sL -o /tmp/mage_1.15.0_Linux-64bit.tar.gz https://github.com/magefile/mage/releases/download/v1.15.0/mage_1.15.0_Linux-64bit.tar.gz + tar -C /tmp -xf /tmp/mage_1.15.0_Linux-64bit.tar.gz + mv /tmp/mage /usr/local/bin/mage + echo "alias ll='ls -la'" > /etc/profile.d/ll.sh + echo 'export PATH=$PATH:/usr/local/go/bin' > /etc/profile.d/go.sh + echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> /etc/profile.d/go.sh + SHELL + end + +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) end diff --git a/auditbeat/Dockerfile b/auditbeat/Dockerfile index 17a6f2cc93fc..8338206bbe5e 100644 --- a/auditbeat/Dockerfile +++ b/auditbeat/Dockerfile @@ -1,4 +1,8 @@ +<<<<<<< HEAD FROM golang:1.19.12 +======= +FROM golang:1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) RUN \ apt-get update \ @@ -11,7 +15,7 @@ RUN \ && rm -rf /var/lib/apt/lists/* # Use a virtualenv to avoid the PEP668 "externally managed environment" error caused by conflicts -# with the system Python installation. golang:1.19.10 uses Debian 12 which now enforces PEP668. +# with the system Python installation. golang:1.20.6 uses Debian 12 which now enforces PEP668. ENV VIRTUAL_ENV=/opt/venv RUN python3 -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" diff --git a/dev-tools/kubernetes/filebeat/Dockerfile.debug b/dev-tools/kubernetes/filebeat/Dockerfile.debug new file mode 100644 index 000000000000..0a639f769f37 --- /dev/null +++ b/dev-tools/kubernetes/filebeat/Dockerfile.debug @@ -0,0 +1,21 @@ +FROM golang:1.20.6 as builder + +ENV PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/go/bin:/usr/local/go/bin + +ENV CGO_ENABLED=0 + +RUN go install github.com/go-delve/delve/cmd/dlv@v1.9.0 + +COPY build/filebeat-debugger /usr/share/filebeat/filebeat-debugger + +FROM alpine:3.15 + +ENV PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/go/bin + +WORKDIR /usr/share/filebeat + +COPY --from=builder /go/bin/dlv /go/bin/dlv +COPY --from=builder /usr/share/filebeat/filebeat-debugger /usr/share/filebeat/filebeat-debugger + +ENTRYPOINT ["dlv", "--headless", "--listen=:56268", "--api-version=2", "--log", "--log-output", "debugger", "exec", "/usr/share/filebeat/filebeat-debugger", "--"] +CMD [ "-e" ] diff --git a/dev-tools/kubernetes/heartbeat/Dockerfile.debug b/dev-tools/kubernetes/heartbeat/Dockerfile.debug new file mode 100644 index 000000000000..e6787232a5b2 --- /dev/null +++ b/dev-tools/kubernetes/heartbeat/Dockerfile.debug @@ -0,0 +1,21 @@ +FROM golang:1.20.6 as builder + +ENV PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/go/bin:/usr/local/go/bin + +ENV CGO_ENABLED=0 + +RUN go install github.com/go-delve/delve/cmd/dlv@v1.9.0 + +COPY build/heartbeat-debugger /usr/share/heartbeat/heartbeat-debugger + +FROM alpine:3.16 + +ENV PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/go/bin + +WORKDIR /usr/share/heartbeat + +COPY --from=builder /go/bin/dlv /go/bin/dlv +COPY --from=builder /usr/share/heartbeat/heartbeat-debugger /usr/share/heartbeat/heartbeat-debugger + +ENTRYPOINT ["dlv", "--headless", "--listen=:56268", "--api-version=2", "--log", "--log-output", "debugger", "exec", "/usr/share/heartbeat/heartbeat-debugger", "--"] +CMD [ "-e" ] diff --git a/dev-tools/kubernetes/metricbeat/Dockerfile.debug b/dev-tools/kubernetes/metricbeat/Dockerfile.debug new file mode 100644 index 000000000000..c4f357ec5a2a --- /dev/null +++ b/dev-tools/kubernetes/metricbeat/Dockerfile.debug @@ -0,0 +1,21 @@ +FROM golang:1.20.6 as builder + +ENV PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/go/bin:/usr/local/go/bin + +ENV CGO_ENABLED=0 + +RUN go install github.com/go-delve/delve/cmd/dlv@v1.9.0 + +COPY build/metricbeat-debugger /usr/share/metricbeat/metricbeat-debugger + +FROM alpine:3.15 + +ENV PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/go/bin + +WORKDIR /usr/share/metricbeat + +COPY --from=builder /go/bin/dlv /go/bin/dlv +COPY --from=builder /usr/share/metricbeat/metricbeat-debugger /usr/share/metricbeat/metricbeat-debugger + +ENTRYPOINT ["dlv", "--headless", "--listen=:56268", "--api-version=2", "--log", "--log-output", "debugger", "exec", "/usr/share/metricbeat/metricbeat-debugger", "--"] +CMD [ "-e" ] diff --git a/dev-tools/mage/gotest.go b/dev-tools/mage/gotest.go index a2e6582ca7e0..1648159abb0e 100644 --- a/dev-tools/mage/gotest.go +++ b/dev-tools/mage/gotest.go @@ -126,7 +126,7 @@ func DefaultTestBinaryArgs() TestBinaryArgs { } // GoTestIntegrationForModule executes the Go integration tests sequentially. -// Currently all test cases must be present under "./module" directory. +// Currently, all test cases must be present under "./module" directory. // // Motivation: previous implementation executed all integration tests at once, // causing high CPU load, high memory usage and resulted in timeouts. @@ -295,13 +295,21 @@ func GoTest(ctx context.Context, params GoTestArgs) error { // Generate a HTML code coverage report. var htmlCoverReport string if params.CoverageProfileFile != "" { + htmlCoverReport = strings.TrimSuffix(params.CoverageProfileFile, filepath.Ext(params.CoverageProfileFile)) + ".html" + coverToHTML := sh.RunCmd("go", "tool", "cover", "-html="+params.CoverageProfileFile, "-o", htmlCoverReport) +<<<<<<< HEAD if err = coverToHTML(); err != nil { return errors.Wrap(err, "failed to write HTML code coverage report") +======= + + if err := coverToHTML(); err != nil { + return fmt.Errorf("failed to write HTML code coverage report: %w", err) +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) } } diff --git a/dev-tools/mage/gotest_test.go b/dev-tools/mage/gotest_test.go index edbb1e549f99..49784c0fd6c2 100644 --- a/dev-tools/mage/gotest_test.go +++ b/dev-tools/mage/gotest_test.go @@ -210,41 +210,41 @@ var wantTestAssertOutput = `(?sm: Error Trace: gotest_test.go:\d+.* Error: Should be true.* Test: TestGoTest_Helper_AssertOutput/assert_fails.* - --- FAIL: TestGoTest_Helper_AssertOutput/assert_fails .* + === FAIL: dev-tools/mage TestGoTest_Helper_AssertOutput/assert_with_message .* gotest_test.go:\d+:.* Error Trace: gotest_test.go:\d+.* Error: Should be true.* Test: TestGoTest_Helper_AssertOutput/assert_with_message.* Messages: My message.* - --- FAIL: TestGoTest_Helper_AssertOutput/assert_with_message .* + === FAIL: dev-tools/mage TestGoTest_Helper_AssertOutput/assert_with_messagef .* gotest_test.go:\d+:.* Error Trace: gotest_test.go:\d+.* Error: Should be true.* Test: TestGoTest_Helper_AssertOutput/assert_with_messagef.* Messages: My message with arguments: 42.* - --- FAIL: TestGoTest_Helper_AssertOutput/assert_with_messagef .* + === FAIL: dev-tools/mage TestGoTest_Helper_AssertOutput/require_fails .* gotest_test.go:\d+:.* Error Trace: gotest_test.go:\d+.* Error: Should be true.* Test: TestGoTest_Helper_AssertOutput/require_fails.* - --- FAIL: TestGoTest_Helper_AssertOutput/require_fails .* + === FAIL: dev-tools/mage TestGoTest_Helper_AssertOutput/require_with_message .* gotest_test.go:\d+:.* Error Trace: gotest_test.go:\d+.* Error: Should be true.* Test: TestGoTest_Helper_AssertOutput/require_with_message.* Messages: My message.* - --- FAIL: TestGoTest_Helper_AssertOutput/require_with_message .* + === FAIL: dev-tools/mage TestGoTest_Helper_AssertOutput/require_with_messagef .* gotest_test.go:\d+:.* Error Trace: gotest_test.go:\d+.* Error: Should be true.* Test: TestGoTest_Helper_AssertOutput/require_with_messagef.* Messages: My message with arguments: 42.* - --- FAIL: TestGoTest_Helper_AssertOutput/require_with_messagef .* + === FAIL: dev-tools/mage TestGoTest_Helper_AssertOutput/equals_map .* gotest_test.go:\d+:.* Error Trace: gotest_test.go:\d+.* @@ -306,17 +306,17 @@ var wantTestLogOutput = `(?sm: gotest_test.go:\d+: printf style log message: 42.* gotest_test.go:\d+: Log should fail.* gotest_test.go:\d+: Log should fail with printf style log: 23.* - --- FAIL: TestGoTest_Helper_LogOutput/on_error.* + === FAIL: dev-tools/mage TestGoTest_Helper_LogOutput/on_fatal.* gotest_test.go:\d+: Log message should be printed.* gotest_test.go:\d+: printf style log message: 42.* gotest_test.go:\d+: Log should fail.* - --- FAIL: TestGoTest_Helper_LogOutput/on_fatal.* + === FAIL: dev-tools/mage TestGoTest_Helper_LogOutput/on_fatalf.* gotest_test.go:\d+: Log message should be printed.* gotest_test.go:\d+: printf style log message: 42.* gotest_test.go:\d+: Log should fail with printf style log: 42.* - --- FAIL: TestGoTest_Helper_LogOutput/on_fatalf.* + === FAIL: dev-tools/mage TestGoTest_Helper_LogOutput/with_newlines.* gotest_test.go:\d+: Log.* message.* @@ -336,7 +336,7 @@ var wantTestLogOutput = `(?sm: style.* log:.* 42.* - --- FAIL: TestGoTest_Helper_LogOutput/with_newlines.* + === FAIL: dev-tools/mage TestGoTest_Helper_LogOutput.* DONE 5 tests, 5 failures in.* )` diff --git a/filebeat/input/syslog/format_check.go b/filebeat/input/syslog/format_check.go index 5ba3e5510032..8d646e10f7d8 100644 --- a/filebeat/input/syslog/format_check.go +++ b/filebeat/input/syslog/format_check.go @@ -17,7 +17,7 @@ // Code generated by ragel DO NOT EDIT. // -//line parser/format_check.rl:1 +// line-disable-directive parser/format_check.rl:1 package syslog //line format_check.go:8 @@ -27,7 +27,7 @@ const format_check_error int = 0 const format_check_en_main int = 1 -//line parser/format_check.rl:9 +// line-disable-directive parser/format_check.rl:9 func IsRFC5424Format(data []byte) bool { var p, cs int @@ -143,7 +143,7 @@ func IsRFC5424Format(data []byte) bool { } goto st0 tr9: -//line parser/format_check.rl:17 + // line-disable-directive parser/format_check.rl:17 isRFC5424 = true @@ -294,7 +294,7 @@ func IsRFC5424Format(data []byte) bool { } } -//line parser/format_check.rl:28 + // line-disable-directive parser/format_check.rl:28 return isRFC5424 } diff --git a/filebeat/input/syslog/rfc3164_parser.go b/filebeat/input/syslog/rfc3164_parser.go index d717ee7be4cb..63d43cdf200d 100644 --- a/filebeat/input/syslog/rfc3164_parser.go +++ b/filebeat/input/syslog/rfc3164_parser.go @@ -17,7 +17,7 @@ // Code generated by ragel DO NOT EDIT. // -//line parser/rfc3164_parser.rl:1 +// line-disable-directive parser/rfc3164_parser.rl:1 package syslog //line rfc3164_parser.go:8 @@ -28,7 +28,7 @@ const syslog_rfc3154_error int = -1 const syslog_rfc3154_en_main int = 0 const syslog_rfc3154_en_catch_all int = 1 -//line parser/rfc3164_parser.rl:9 +// line-disable-directive parser/rfc3164_parser.rl:9 var ( noDuplicates = []byte{'-', '.'} @@ -332,17 +332,17 @@ func ParserRFC3164(data []byte, event *event) { } goto tr0 tr0: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st2 tr134: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -355,17 +355,17 @@ func ParserRFC3164(data []byte, event *event) { //line rfc3164_parser.go:342 goto st2 tr1: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st3 tr135: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -399,17 +399,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr14: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st4 tr136: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -452,7 +452,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr18: -//line parser/common.rl:19 + // line-disable-directive parser/common.rl:19 event.SetYear(data[tok:p]) @@ -468,7 +468,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr19: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -493,7 +493,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr21: -//line parser/common.rl:23 + // line-disable-directive parser/common.rl:23 event.SetMonthNumeric(data[tok:p]) @@ -509,7 +509,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr22: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -542,7 +542,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr24: -//line parser/common.rl:27 + // line-disable-directive parser/common.rl:27 event.SetDay(data[tok:p]) @@ -561,7 +561,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr25: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -586,7 +586,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr28: -//line parser/common.rl:31 + // line-disable-directive parser/common.rl:31 event.SetHour(data[tok:p]) @@ -602,7 +602,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr29: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -627,7 +627,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr31: -//line parser/common.rl:35 + // line-disable-directive parser/common.rl:35 event.SetMinute(data[tok:p]) @@ -643,7 +643,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr32: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -684,19 +684,19 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr34: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) goto st23 tr61: -//line parser/common.rl:103 + // line-disable-directive parser/common.rl:103 event.SetTimeZone(data[tok:p]) goto st23 tr68: -//line parser/common.rl:43 + // line-disable-directive parser/common.rl:43 event.SetNanosecond(data[tok:p]) @@ -732,11 +732,11 @@ func ParserRFC3164(data []byte, event *event) { } goto tr0 tr39: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -751,7 +751,7 @@ func ParserRFC3164(data []byte, event *event) { goto st24 tr42: -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -796,11 +796,11 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr40: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -815,7 +815,7 @@ func ParserRFC3164(data []byte, event *event) { goto st25 tr43: -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -867,7 +867,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr45: -//line parser/common.rl:91 + // line-disable-directive parser/common.rl:91 event.SetHostname(data[tok:p]) @@ -891,7 +891,7 @@ func ParserRFC3164(data []byte, event *event) { } goto tr47 tr47: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -917,7 +917,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st27 tr49: -//line parser/common.rl:95 + // line-disable-directive parser/common.rl:95 event.SetProgram(data[tok:p]) @@ -949,7 +949,7 @@ func ParserRFC3164(data []byte, event *event) { st_case_29: goto tr0 tr50: -//line parser/common.rl:95 + // line-disable-directive parser/common.rl:95 event.SetProgram(data[tok:p]) @@ -965,7 +965,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr52: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -984,7 +984,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr54: -//line parser/common.rl:99 + // line-disable-directive parser/common.rl:99 event.SetPid(data[tok:p]) @@ -1012,7 +1012,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr46: -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -1025,7 +1025,7 @@ func ParserRFC3164(data []byte, event *event) { } } -//line parser/common.rl:91 + // line-disable-directive parser/common.rl:91 event.SetHostname(data[tok:p]) @@ -1068,7 +1068,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr57: -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -1083,7 +1083,7 @@ func ParserRFC3164(data []byte, event *event) { goto st35 tr58: -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -1096,7 +1096,7 @@ func ParserRFC3164(data []byte, event *event) { } } -//line parser/common.rl:91 + // line-disable-directive parser/common.rl:91 event.SetHostname(data[tok:p]) @@ -1139,11 +1139,11 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr41: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -1158,7 +1158,7 @@ func ParserRFC3164(data []byte, event *event) { goto st36 tr44: -//line parser/common.rl:80 + // line-disable-directive parser/common.rl:80 if p-1 > 0 { for _, b := range noDuplicates { @@ -1203,21 +1203,21 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr35: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st37 tr69: -//line parser/common.rl:43 + // line-disable-directive parser/common.rl:43 event.SetNanosecond(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1286,19 +1286,19 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr37: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) goto st42 tr65: -//line parser/common.rl:103 + // line-disable-directive parser/common.rl:103 event.SetTimeZone(data[tok:p]) goto st42 tr71: -//line parser/common.rl:43 + // line-disable-directive parser/common.rl:43 event.SetNanosecond(data[tok:p]) @@ -1317,7 +1317,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr63: -//line parser/common.rl:103 + // line-disable-directive parser/common.rl:103 event.SetTimeZone(data[tok:p]) @@ -1341,7 +1341,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr36: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) @@ -1357,7 +1357,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr67: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1392,21 +1392,21 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr38: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st46 tr72: -//line parser/common.rl:43 + // line-disable-directive parser/common.rl:43 event.SetNanosecond(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1432,7 +1432,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr26: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1448,17 +1448,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr4: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st48 tr137: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1501,7 +1501,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr77: -//line parser/common.rl:15 + // line-disable-directive parser/common.rl:15 event.SetMonth(data[tok:p]) @@ -1543,7 +1543,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr83: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1562,7 +1562,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr84: -//line parser/common.rl:27 + // line-disable-directive parser/common.rl:27 event.SetDay(data[tok:p]) @@ -1581,7 +1581,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr85: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1606,7 +1606,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr88: -//line parser/common.rl:31 + // line-disable-directive parser/common.rl:31 event.SetHour(data[tok:p]) @@ -1622,7 +1622,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr89: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1647,7 +1647,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr91: -//line parser/common.rl:35 + // line-disable-directive parser/common.rl:35 event.SetMinute(data[tok:p]) @@ -1663,7 +1663,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr92: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1696,7 +1696,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr94: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) @@ -1712,7 +1712,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr95: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1739,7 +1739,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr86: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1755,7 +1755,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr80: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1771,7 +1771,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr81: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1795,7 +1795,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr82: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1882,17 +1882,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr5: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st75 tr138: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1968,17 +1968,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr6: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st82 tr139: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2054,17 +2054,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr7: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st89 tr140: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2149,17 +2149,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr8: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st95 tr141: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2216,17 +2216,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr9: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st99 tr142: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2251,17 +2251,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr10: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st101 tr143: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2301,17 +2301,17 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr11: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st104 tr144: -//line parser/common.rl:107 + // line-disable-directive parser/common.rl:107 event.SetSequence(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2360,7 +2360,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr2: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2442,7 +2442,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr133: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2482,7 +2482,7 @@ func ParserRFC3164(data []byte, event *event) { } goto tr134 tr3: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2498,7 +2498,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr145: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2562,7 +2562,7 @@ func ParserRFC3164(data []byte, event *event) { } goto st2 tr147: -//line parser/common.rl:7 + // line-disable-directive parser/common.rl:7 event.SetPriority(data[tok:p]) @@ -2608,7 +2608,7 @@ func ParserRFC3164(data []byte, event *event) { st_case_1: goto tr12 tr12: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2994,7 +2994,7 @@ func ParserRFC3164(data []byte, event *event) { if (p) == eof { switch cs { case 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122: -//line parser/common.rl:11 + // line-disable-directive parser/common.rl:11 event.SetMessage(data[tok:p]) @@ -3004,6 +3004,6 @@ func ParserRFC3164(data []byte, event *event) { } -//line parser/rfc3164_parser.rl:28 + // line-disable-directive parser/rfc3164_parser.rl:28 } diff --git a/filebeat/input/syslog/rfc5424_parser.go b/filebeat/input/syslog/rfc5424_parser.go index 8622f309fb26..a3bb182a169f 100644 --- a/filebeat/input/syslog/rfc5424_parser.go +++ b/filebeat/input/syslog/rfc5424_parser.go @@ -17,7 +17,7 @@ // Code generated by ragel DO NOT EDIT. // -//line parser/rfc5424_parser.rl:1 +// line-disable-directive parser/rfc5424_parser.rl:1 package syslog //line rfc5424_parser.go:8 @@ -27,7 +27,7 @@ const syslog_rfc5424_error int = 0 const syslog_rfc5424_en_main int = 1 -//line parser/rfc5424_parser.rl:9 +// line-disable-directive parser/rfc5424_parser.rl:9 type machineState struct { sd_id string @@ -1266,7 +1266,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr2: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1282,7 +1282,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr5: -//line parser/common.rl:7 + // line-disable-directive parser/common.rl:7 event.SetPriority(data[tok:p]) @@ -1298,7 +1298,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr6: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1317,7 +1317,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr7: -//line parser/common.rl:111 + // line-disable-directive parser/common.rl:111 event.SetVersion(data[tok:p]) @@ -1358,7 +1358,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr586: -//line parser/common.rl:103 + // line-disable-directive parser/common.rl:103 event.SetTimeZone(data[tok:p]) @@ -1374,7 +1374,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr12: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1393,7 +1393,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr13: -//line parser/common.rl:91 + // line-disable-directive parser/common.rl:91 event.SetHostname(data[tok:p]) @@ -1409,7 +1409,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr15: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1428,7 +1428,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr16: -//line parser/common.rl:115 + // line-disable-directive parser/common.rl:115 event.SetAppName(data[tok:p]) @@ -1444,7 +1444,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr18: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1463,7 +1463,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr19: -//line parser/common.rl:119 + // line-disable-directive parser/common.rl:119 event.SetProcID(data[tok:p]) @@ -1479,7 +1479,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr21: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1498,7 +1498,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr22: -//line parser/common.rl:123 + // line-disable-directive parser/common.rl:123 event.SetMsgID(data[tok:p]) @@ -1532,7 +1532,7 @@ func ParserRFC5424(data []byte, event *event) { st_case_589: goto tr600 tr600: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1545,7 +1545,7 @@ func ParserRFC5424(data []byte, event *event) { //line rfc5424_parser.go:1532 goto st590 tr25: -//line parser/common.rl:48 + // line-disable-directive parser/common.rl:48 event.data = EventData{} @@ -1573,7 +1573,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr26: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -1602,7 +1602,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr27: -//line parser/common.rl:64 + // line-disable-directive parser/common.rl:64 state.sd_id = string(data[tok:p]) if _, ok := event.data[state.sd_id]; ok { @@ -1636,7 +1636,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr30: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2272,7 +2272,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr32: -//line parser/common.rl:56 + // line-disable-directive parser/common.rl:56 state.sd_param_name = string(data[tok:p]) @@ -2302,7 +2302,7 @@ func ParserRFC5424(data []byte, event *event) { } goto tr64 tr64: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -2323,11 +2323,11 @@ func ParserRFC5424(data []byte, event *event) { } goto st54 tr67: -//line parser/common.rl:60 + // line-disable-directive parser/common.rl:60 event.SetData(state.sd_id, state.sd_param_name, data, tok, p, state.sd_value_bs) -//line parser/common.rl:52 + // line-disable-directive parser/common.rl:52 state.sd_value_bs = []int{} @@ -2356,7 +2356,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr29: -//line parser/common.rl:64 + // line-disable-directive parser/common.rl:64 state.sd_id = string(data[tok:p]) if _, ok := event.data[state.sd_id]; ok { @@ -2381,17 +2381,17 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr65: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p -//line parser/common.rl:73 + // line-disable-directive parser/common.rl:73 state.sd_value_bs = append(state.sd_value_bs, p) goto st56 tr68: -//line parser/common.rl:73 + // line-disable-directive parser/common.rl:73 state.sd_value_bs = append(state.sd_value_bs, p) @@ -8578,7 +8578,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr10: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -8621,7 +8621,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr559: -//line parser/common.rl:19 + // line-disable-directive parser/common.rl:19 event.SetYear(data[tok:p]) @@ -8640,7 +8640,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr560: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -8665,7 +8665,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr563: -//line parser/common.rl:23 + // line-disable-directive parser/common.rl:23 event.SetMonthNumeric(data[tok:p]) @@ -8687,7 +8687,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr564: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -8712,7 +8712,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr568: -//line parser/common.rl:27 + // line-disable-directive parser/common.rl:27 event.SetDay(data[tok:p]) @@ -8731,7 +8731,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr569: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -8756,7 +8756,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr572: -//line parser/common.rl:31 + // line-disable-directive parser/common.rl:31 event.SetHour(data[tok:p]) @@ -8772,7 +8772,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr573: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -8797,7 +8797,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr575: -//line parser/common.rl:35 + // line-disable-directive parser/common.rl:35 event.SetMinute(data[tok:p]) @@ -8813,7 +8813,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr576: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -8845,21 +8845,21 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr578: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p goto st566 tr588: -//line parser/common.rl:43 + // line-disable-directive parser/common.rl:43 event.SetNanosecond(data[tok:p]) -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -8910,6 +8910,29 @@ func ParserRFC5424(data []byte, event *event) { goto st571 } goto st0 +<<<<<<< HEAD +======= + tr580: + // line-disable-directive parser/common.rl:39 + + event.SetSecond(data[tok:p]) + + // line-disable-directive parser/common.rl:3 + + tok = p + + goto st571 + tr590: + // line-disable-directive parser/common.rl:43 + + event.SetNanosecond(data[tok:p]) + + // line-disable-directive parser/common.rl:3 + + tok = p + + goto st571 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) st571: if (p)++; (p) == (pe) { goto _test_eof571 @@ -8920,7 +8943,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr579: -//line parser/common.rl:39 + // line-disable-directive parser/common.rl:39 event.SetSecond(data[tok:p]) @@ -8936,7 +8959,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr587: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -9042,7 +9065,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr570: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -9058,7 +9081,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr565: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -9074,7 +9097,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr566: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -9090,7 +9113,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr561: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -9127,7 +9150,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr3: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -9149,7 +9172,7 @@ func ParserRFC5424(data []byte, event *event) { } goto st0 tr4: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p @@ -10957,16 +10980,16 @@ func ParserRFC5424(data []byte, event *event) { if (p) == eof { switch cs { case 590: -//line parser/common.rl:11 + // line-disable-directive parser/common.rl:11 event.SetMessage(data[tok:p]) case 589: -//line parser/common.rl:3 + // line-disable-directive parser/common.rl:3 tok = p -//line parser/common.rl:11 + // line-disable-directive parser/common.rl:11 event.SetMessage(data[tok:p]) @@ -10979,6 +11002,6 @@ func ParserRFC5424(data []byte, event *event) { } } -//line parser/rfc5424_parser.rl:35 + // line-disable-directive parser/rfc5424_parser.rl:35 } diff --git a/heartbeat/Dockerfile b/heartbeat/Dockerfile index 52a87012c7ee..702a77dea408 100644 --- a/heartbeat/Dockerfile +++ b/heartbeat/Dockerfile @@ -1,4 +1,8 @@ +<<<<<<< HEAD FROM golang:1.19.12 +======= +FROM golang:1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) RUN \ apt-get update \ @@ -10,7 +14,7 @@ RUN \ && rm -rf /var/lib/apt/lists/* # Use a virtualenv to avoid the PEP668 "externally managed environment" error caused by conflicts -# with the system Python installation. golang:1.19.10 uses Debian 12 which now enforces PEP668. +# with the system Python installation. golang:1.20.6 uses Debian 12 which now enforces PEP668. ENV VIRTUAL_ENV=/opt/venv RUN python3 -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" diff --git a/libbeat/docs/version.asciidoc b/libbeat/docs/version.asciidoc index 98cf087c9e68..e20c86a9ff8e 100644 --- a/libbeat/docs/version.asciidoc +++ b/libbeat/docs/version.asciidoc @@ -1,6 +1,12 @@ +<<<<<<< HEAD :stack-version: 7.17.14 :doc-branch: 7.17 :go-version: 1.19.12 +======= +:stack-version: 8.10.0 +:doc-branch: main +:go-version: 1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) :release-state: unreleased :python: 3.7 :docker: 1.12 diff --git a/libbeat/reader/syslog/rfc3164_test.go b/libbeat/reader/syslog/rfc3164_test.go new file mode 100644 index 000000000000..d1c75fe574eb --- /dev/null +++ b/libbeat/reader/syslog/rfc3164_test.go @@ -0,0 +1,241 @@ +// 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 syslog + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestParseRFC3164(t *testing.T) { + tests := map[string]struct { + in string + want message + wantErr string + }{ + "ok": { + in: "<13>Oct 11 22:14:15 test-host this is the message", + want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + }, + "ok-rfc3339": { + in: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + }, + "ok-process": { + in: "<13>Oct 11 22:14:15 test-host su: this is the message", + want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + msg: "this is the message", + }, + }, + "ok-process-pid": { + in: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", + want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1024", + msg: "this is the message", + }, + }, + "non-standard-date": { + in: "<123>Sep 01 02:03:04 hostname message", + want: message{ + timestamp: mustParseTime(time.Stamp, "Sep 1 02:03:04", time.Local), + priority: 123, + facility: 15, + severity: 3, + hostname: "hostname", + msg: "message", + }, + }, + "err-pri-not-a-number": { + in: "Oct 11 22:14:15 test-host this is the message", + want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: -1, + hostname: "test-host", + msg: "this is the message", + }, + wantErr: `validation error at position 2: invalid priority: strconv.Atoi: parsing "abc": invalid syntax`, + }, + "err-pri-out-of-range": { + in: "<192>Oct 11 22:14:15 test-host this is the message", + want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: -1, + hostname: "test-host", + msg: "this is the message", + }, + wantErr: `validation error at position 2: priority value out of range (expected 0..191)`, + }, + "err-pri-negative": { + in: "<-1>Oct 11 22:14:15 test-host this is the message", + want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: -1, + hostname: "test-host", + msg: "this is the message", + }, + wantErr: `validation error at position 2: priority value out of range (expected 0..191)`, + }, + "err-pri-missing-brackets": { + in: "13 Oct 11 22:14:15 test-host this is the message", + want: message{ + priority: -1, + hostname: "Oct", + msg: "11 22:14:15 test-host this is the message", + }, + wantErr: `validation error at position 1: parsing time "13" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "13" as "2006"`, + }, + "err-ts-invalid-missing": { + in: "<13> test-host this is the message", + want: message{ + priority: 13, + facility: 1, + severity: 5, + }, + wantErr: `parsing error at position 5: unexpected EOF`, + }, + "err-ts-invalid-bsd": { + in: "<13>Foo 11 22:14:15 test-host this is the message", + want: message{ + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + wantErr: `validation error at position 5: parsing time "Foo 11 22:14:15" as "Jan _2 15:04:05": cannot parse "Foo 11 22:14:15" as "Jan"`, + }, + "err-ts-invalid-rfc3339": { + in: "<13>24-08-2003T05:14:15-07:00 test-host this is the message", + want: message{ + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + wantErr: `validation error at position 5: parsing time "24-08-2003T05:14:15-07:00" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "24-08-2003T05:14:15-07:00" as "2006"`, + }, + "err-eof": { + in: "<13>Oct 11 22:14:15 test-", + want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + }, + wantErr: `parsing error at position 26: unexpected EOF`, + }, + } + + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + + got, gotErr := parseRFC3164(tc.in, time.Local) + + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) + } else { + assert.NoError(t, gotErr) + } + assert.Equal(t, tc.want, got) + }) + } +} + +func BenchmarkParseRFC3164(b *testing.B) { + tests := map[string]struct { + in string + }{ + "ok": { + in: "<13>Oct 11 22:14:15 test-host this is the message", + }, + "ok-rfc3339": { + in: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", + }, + "ok-process": { + in: "<13>Oct 11 22:14:15 test-host su: this is the message", + }, + "ok-process-pid": { + in: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", + }, + "non-standard-date": { + in: "<123>Sep 01 02:03:04 hostname message", + }, + "err-pri-not-a-number": { + in: "Oct 11 22:14:15 test-host this is the message", + }, + "err-pri-out-of-range": { + in: "<192>Oct 11 22:14:15 test-host this is the message", + }, + "err-pri-negative": { + in: "<-1>Oct 11 22:14:15 test-host this is the message", + }, + "err-pri-missing-brackets": { + in: "13 Oct 11 22:14:15 test-host this is the message", + }, + "err-ts-invalid-missing": { + in: "<13> test-host this is the message", + }, + "err-ts-invalid-bsd": { + in: "<13>Foo 11 22:14:15 test-host this is the message", + }, + "err-ts-invalid-rfc3339": { + in: "<13>2003-08-24 05:14:15-07:00 test-host this is the message", + }, + } + + for name, bc := range tests { + bc := bc + b.Run(name, func(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + _, _ = parseRFC3164(bc.in, time.Local) + } + }) + } +} diff --git a/libbeat/reader/syslog/rfc5424_test.go b/libbeat/reader/syslog/rfc5424_test.go new file mode 100644 index 000000000000..47cb9ee0e363 --- /dev/null +++ b/libbeat/reader/syslog/rfc5424_test.go @@ -0,0 +1,279 @@ +// 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 syslog + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestParseRFC5424(t *testing.T) { + tests := map[string]struct { + in string + want message + wantErr string + }{ + "example-1": { + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1234", + msg: "This is a test message", + msgID: "msg-5678", + version: 1, + }, + }, + "example-2": { + in: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1234", + msg: "This is a test message", + msgID: "msg-5678", + version: 1, + rawSDValue: `[sd-id-1 foo="bar"]`, + }, + }, + "example-3": { + in: `<13>1 - - - - - -`, + want: message{ + priority: 13, + facility: 1, + severity: 5, + version: 1, + }, + }, + "example-4": { + in: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 34, + facility: 4, + severity: 2, + version: 1, + hostname: "mymachine.example.com", + process: "su", + msgID: "ID47", + msg: `'su root' failed for user1 on /dev/pts/8`, + }, + }, + "example-5": { + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + }, + "non-compliant-sd": { + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + }, + }, + "non-compliant-sd-with-msg": { + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"] This is a test message`, + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + msg: "This is a test message", + }, + }, + "err-invalid-version": { + in: `<165>A 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + wantErr: `validation error at position 6: invalid version, expected an integer: strconv.Atoi: parsing "A": invalid syntax`, + }, + "err-invalid-timestamp": { + in: `<165>1 10-11-2003T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + want: message{ + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + wantErr: "validation error at position 8: parsing time \"10-11-2003T22:14:15.003Z\" as \"2006-01-02T15:04:05.999999999Z07:00\": cannot parse \"10-11-2003T22:14:15.003Z\" as \"2006\"", + }, + "err-eof": { + in: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-`, + want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1234", + version: 1, + }, + wantErr: `parsing error at position 62: unexpected EOF`, + }, + } + + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + + got, gotErr := parseRFC5424(tc.in) + + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) + } else { + assert.NoError(t, gotErr) + } + + assert.Equal(t, tc.want, got) + }) + } +} + +func BenchmarkParseRFC5424(b *testing.B) { + tests := map[string]struct { + in string + }{ + "example-1": { + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + }, + "example-2": { + in: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, + }, + "example-3": { + in: `<13>1 - - - - - -`, + }, + "example-4": { + in: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, + }, + "example-5": { + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + } + + for name, bc := range tests { + bc := bc + b.Run(name, func(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + _, _ = parseRFC5424(bc.in) + } + }) + } +} + +func TestIsRFC5424(t *testing.T) { + tests := map[string]struct { + in string + want bool + }{ + "rfc-5424": { + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + want: true, + }, + "rfc-3164": { + in: "<13>Oct 11 22:14:15 test-host this is the message", + want: false, + }, + "invalid-message": { + in: "not a valid message", + want: false, + }, + } + + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + + got := isRFC5424(tc.in) + + assert.Equal(t, tc.want, got) + }) + } +} + +func BenchmarkIsRFC5424(b *testing.B) { + tests := map[string]struct { + in string + }{ + "rfc-5424": { + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + }, + "rfc-3164": { + in: "<13>Oct 11 22:14:15 test-host this is the message", + }, + "invalid-message": { + in: "not a valid message", + }, + } + + for name, bc := range tests { + bc := bc + b.Run(name, func(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + _ = isRFC5424(bc.in) + } + }) + } +} diff --git a/metricbeat/Dockerfile b/metricbeat/Dockerfile index 6acb23f9ee5a..595ecd9dffad 100644 --- a/metricbeat/Dockerfile +++ b/metricbeat/Dockerfile @@ -1,4 +1,8 @@ +<<<<<<< HEAD FROM golang:1.19.12 +======= +FROM golang:1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) RUN \ apt update \ @@ -11,7 +15,7 @@ RUN \ && rm -rf /var/lib/apt/lists/* # Use a virtualenv to avoid the PEP668 "externally managed environment" error caused by conflicts -# with the system Python installation. golang:1.19.10 uses Debian 12 which now enforces PEP668. +# with the system Python installation. golang:1.20.6 uses Debian 12 which now enforces PEP668. ENV VIRTUAL_ENV=/opt/venv RUN python3 -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" diff --git a/metricbeat/module/http/_meta/Dockerfile b/metricbeat/module/http/_meta/Dockerfile index 88b4a998e1f9..a9e20de69734 100644 --- a/metricbeat/module/http/_meta/Dockerfile +++ b/metricbeat/module/http/_meta/Dockerfile @@ -1,4 +1,8 @@ +<<<<<<< HEAD FROM golang:1.19.12 +======= +FROM golang:1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) COPY test/main.go main.go diff --git a/metricbeat/module/nats/_meta/Dockerfile b/metricbeat/module/nats/_meta/Dockerfile index 1aa49898dff8..ee0267a54e7d 100644 --- a/metricbeat/module/nats/_meta/Dockerfile +++ b/metricbeat/module/nats/_meta/Dockerfile @@ -2,7 +2,11 @@ ARG NATS_VERSION=2.0.4 FROM nats:$NATS_VERSION # build stage +<<<<<<< HEAD FROM golang:1.19.12 AS build-env +======= +FROM golang:1.20.6 AS build-env +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) RUN apt-get install git mercurial gcc RUN git clone https://github.com/nats-io/nats.go.git /nats-go RUN cd /nats-go/examples/nats-bench && git checkout tags/v1.10.0 && go build . diff --git a/packetbeat/Dockerfile b/packetbeat/Dockerfile index a9472f155e5b..dcae5828e395 100644 --- a/packetbeat/Dockerfile +++ b/packetbeat/Dockerfile @@ -1,4 +1,8 @@ +<<<<<<< HEAD FROM golang:1.19.12 +======= +FROM golang:1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) RUN \ apt-get update \ @@ -12,7 +16,7 @@ RUN \ && rm -rf /var/lib/apt/lists/* # Use a virtualenv to avoid the PEP668 "externally managed environment" error caused by conflicts -# with the system Python installation. golang:1.19.10 uses Debian 12 which now enforces PEP668. +# with the system Python installation. golang:1.20.6 uses Debian 12 which now enforces PEP668. ENV VIRTUAL_ENV=/opt/venv RUN python3 -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" diff --git a/x-pack/functionbeat/Dockerfile b/x-pack/functionbeat/Dockerfile index a3bb21b33b25..13a4d7b12c34 100644 --- a/x-pack/functionbeat/Dockerfile +++ b/x-pack/functionbeat/Dockerfile @@ -1,4 +1,8 @@ +<<<<<<< HEAD FROM golang:1.19.12 +======= +FROM golang:1.20.6 +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) RUN \ apt-get update \ @@ -11,7 +15,7 @@ RUN \ && rm -rf /var/lib/apt/lists/* # Use a virtualenv to avoid the PEP668 "externally managed environment" error caused by conflicts -# with the system Python installation. golang:1.19.10 uses Debian 12 which now enforces PEP668. +# with the system Python installation. golang:1.20.6 uses Debian 12 which now enforces PEP668. ENV VIRTUAL_ENV=/opt/venv RUN python3 -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" diff --git a/x-pack/metricbeat/module/stan/_meta/Dockerfile b/x-pack/metricbeat/module/stan/_meta/Dockerfile index 2cc9ef72439b..aab2418a9414 100644 --- a/x-pack/metricbeat/module/stan/_meta/Dockerfile +++ b/x-pack/metricbeat/module/stan/_meta/Dockerfile @@ -2,7 +2,11 @@ ARG STAN_VERSION=0.15.1 FROM nats-streaming:$STAN_VERSION # build stage +<<<<<<< HEAD FROM golang:1.19.12 AS build-env +======= +FROM golang:1.20.6 AS build-env +>>>>>>> a278734f11 (upgrade Go to 1.20.6 (#36000)) RUN apt-get install git mercurial gcc RUN git clone https://github.com/nats-io/stan.go.git /stan-go RUN cd /stan-go/examples/stan-bench && git checkout tags/v0.5.2 && go build .