diff --git a/.buildkite/aarch64_pipeline.yml b/.buildkite/aarch64_pipeline.yml index 6e25b565d..8c66116fe 100644 --- a/.buildkite/aarch64_pipeline.yml +++ b/.buildkite/aarch64_pipeline.yml @@ -17,6 +17,9 @@ steps: source .buildkite/scripts/common/vm-agent.sh ci/unit_tests.sh ruby + retry: + automatic: + - limit: 3 - label: ":java: Java unit tests" key: "java-unit-tests" @@ -28,40 +31,78 @@ steps: source .buildkite/scripts/common/vm-agent.sh ci/unit_tests.sh java + retry: + automatic: + - limit: 3 - - label: ":lab_coat: Integration Tests / part 1" - key: "integration-tests-part-1" + - label: ":lab_coat: Integration Tests / part 1-of-3" + key: "integration-tests-part-1-of-3" command: | set -euo pipefail source .buildkite/scripts/common/vm-agent.sh - ci/integration_tests.sh split 0 + ci/integration_tests.sh split 0 3 + retry: + automatic: + - limit: 3 - - label: ":lab_coat: Integration Tests / part 2" - key: "integration-tests-part-2" + - label: ":lab_coat: Integration Tests / part 2-of-3" + key: "integration-tests-part-2-of-3" command: | set -euo pipefail source .buildkite/scripts/common/vm-agent.sh - ci/integration_tests.sh split 1 + ci/integration_tests.sh split 1 3 + retry: + automatic: + - limit: 3 - - label: ":lab_coat: IT Persistent Queues / part 1" - key: "integration-tests-qa-part-1" + - label: ":lab_coat: Integration Tests / part 3-of-3" + key: "integration-tests-part-3-of-3" + command: | + set -euo pipefail + + source .buildkite/scripts/common/vm-agent.sh + ci/integration_tests.sh split 2 3 + retry: + automatic: + - limit: 3 + + - label: ":lab_coat: IT Persistent Queues / part 1-of-3" + key: "integration-tests-qa-part-1-of-3" command: | set -euo pipefail source .buildkite/scripts/common/vm-agent.sh export FEATURE_FLAG=persistent_queues - ci/integration_tests.sh split 0 + ci/integration_tests.sh split 0 3 + retry: + automatic: + - limit: 3 - - label: ":lab_coat: IT Persistent Queues / part 2" - key: "integration-tests-qa-part-2" + - label: ":lab_coat: IT Persistent Queues / part 2-of-3" + key: "integration-tests-qa-part-2-of-3" command: | set -euo pipefail source .buildkite/scripts/common/vm-agent.sh export FEATURE_FLAG=persistent_queues - ci/integration_tests.sh split 1 + ci/integration_tests.sh split 1 3 + retry: + automatic: + - limit: 3 + + - label: ":lab_coat: IT Persistent Queues / part 3-of-3" + key: "integration-tests-qa-part-3-of-3" + command: | + set -euo pipefail + + source .buildkite/scripts/common/vm-agent.sh + export FEATURE_FLAG=persistent_queues + ci/integration_tests.sh split 2 3 + retry: + automatic: + - limit: 3 - label: ":lab_coat: x-pack unit tests" key: "x-pack-unit-tests" @@ -70,6 +111,9 @@ steps: source .buildkite/scripts/common/vm-agent.sh x-pack/ci/unit_tests.sh + retry: + automatic: + - limit: 3 - label: ":lab_coat: x-pack integration" key: "integration-tests-x-pack" @@ -78,6 +122,9 @@ steps: source .buildkite/scripts/common/vm-agent.sh x-pack/ci/integration_tests.sh + retry: + automatic: + - limit: 3 - group: "Acceptance Phase" depends_on: "testing-phase" @@ -88,6 +135,9 @@ steps: set -euo pipefail source .buildkite/scripts/common/vm-agent.sh && ci/docker_acceptance_tests.sh {{matrix}} + retry: + automatic: + - limit: 3 matrix: - "full" - "oss" diff --git a/.buildkite/benchmark_marathon_pipeline.yml b/.buildkite/benchmark_marathon_pipeline.yml new file mode 100644 index 000000000..d2f8b6577 --- /dev/null +++ b/.buildkite/benchmark_marathon_pipeline.yml @@ -0,0 +1,11 @@ +agents: + provider: gcp + imageProject: elastic-images-prod + image: family/platform-ingest-logstash-ubuntu-2204 + machineType: "n2-standard-16" + diskSizeGb: 100 + diskType: pd-ssd + +steps: + - label: "Benchmark Marathon" + command: .buildkite/scripts/benchmark/marathon.sh \ No newline at end of file diff --git a/.buildkite/benchmark_pipeline.yml b/.buildkite/benchmark_pipeline.yml new file mode 100644 index 000000000..071ee6996 --- /dev/null +++ b/.buildkite/benchmark_pipeline.yml @@ -0,0 +1,14 @@ +agents: + provider: gcp + imageProject: elastic-images-prod + image: family/platform-ingest-logstash-ubuntu-2204 + machineType: "n2-standard-16" + diskSizeGb: 100 + diskType: pd-ssd + +steps: + - label: "Benchmark Snapshot" + retry: + automatic: + - limit: 3 + command: .buildkite/scripts/benchmark/main.sh \ No newline at end of file diff --git a/.buildkite/dra_pipeline.yml b/.buildkite/dra_pipeline.yml index 4cd3cea93..10007715c 100644 --- a/.buildkite/dra_pipeline.yml +++ b/.buildkite/dra_pipeline.yml @@ -4,8 +4,12 @@ steps: - label: ":pipeline: Generate steps" command: | set -euo pipefail - - echo "--- Building [${WORKFLOW_TYPE}] artifacts" + + echo "--- Building [$${WORKFLOW_TYPE}] artifacts" python3 -m pip install pyyaml echo "--- Building dynamic pipeline steps" - python3 .buildkite/scripts/dra/generatesteps.py | buildkite-agent pipeline upload + python3 .buildkite/scripts/dra/generatesteps.py > steps.yml + echo "--- Printing dynamic pipeline steps" + cat steps.yml + echo "--- Uploading dynamic pipeline steps" + cat steps.yml | buildkite-agent pipeline upload diff --git a/.buildkite/health_report_tests_pipeline.yml b/.buildkite/health_report_tests_pipeline.yml new file mode 100644 index 000000000..93dd4d7ac --- /dev/null +++ b/.buildkite/health_report_tests_pipeline.yml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json + +agents: + provider: gcp + imageProject: elastic-images-prod + image: family/platform-ingest-logstash-ubuntu-2204 + machineType: "n2-standard-4" + diskSizeGb: 64 + +steps: + - group: ":logstash: Health API integration tests" + key: "testing-phase" + steps: + - label: "main branch" + key: "integ-tests-on-main-branch" + command: + - .buildkite/scripts/health-report-tests/main.sh + retry: + automatic: + - limit: 3 \ No newline at end of file diff --git a/.buildkite/jdk_availability_check_pipeline.yml b/.buildkite/jdk_availability_check_pipeline.yml new file mode 100644 index 000000000..3fa826564 --- /dev/null +++ b/.buildkite/jdk_availability_check_pipeline.yml @@ -0,0 +1,14 @@ +steps: + - label: "JDK Availability check" + key: "jdk-availability-check" + agents: + image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci" + cpu: "4" + memory: "6Gi" + ephemeralStorage: "100Gi" + command: | + set -euo pipefail + + source .buildkite/scripts/common/container-agent.sh + export GRADLE_OPTS="-Xmx2g -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info" + ci/check_jdk_version_availability.sh \ No newline at end of file diff --git a/.buildkite/linux_jdk_matrix_pipeline.yml b/.buildkite/linux_jdk_matrix_pipeline.yml index 435fc8adb..4fd7874bf 100644 --- a/.buildkite/linux_jdk_matrix_pipeline.yml +++ b/.buildkite/linux_jdk_matrix_pipeline.yml @@ -5,7 +5,7 @@ env: DEFAULT_MATRIX_OS: "ubuntu-2204" - DEFAULT_MATRIX_JDK: "adoptiumjdk_17" + DEFAULT_MATRIX_JDK: "adoptiumjdk_21" steps: - input: "Test Parameters" @@ -18,6 +18,8 @@ steps: multiple: true default: "${DEFAULT_MATRIX_OS}" options: + - label: "Ubuntu 24.04" + value: "ubuntu-2404" - label: "Ubuntu 22.04" value: "ubuntu-2204" - label: "Ubuntu 20.04" @@ -26,14 +28,10 @@ steps: value: "debian-12" - label: "Debian 11" value: "debian-11" - - label: "Debian 10" - value: "debian-10" - label: "RHEL 9" value: "rhel-9" - label: "RHEL 8" value: "rhel-8" - - label: "CentOS 7" - value: "centos-7" - label: "Oracle Linux 8" value: "oraclelinux-8" - label: "Oracle Linux 7" @@ -62,20 +60,12 @@ steps: value: "adoptiumjdk_21" - label: "Adoptium JDK 17 (Eclipse Temurin)" value: "adoptiumjdk_17" - - label: "Adoptium JDK 11 (Eclipse Temurin)" - value: "adoptiumjdk_11" - label: "OpenJDK 21" value: "openjdk_21" - - label: "OpenJDK 17" - value: "openjdk_17" - - label: "OpenJDK 11" - value: "openjdk_11" - label: "Zulu 21" value: "zulu_21" - label: "Zulu 17" value: "zulu_17" - - label: "Zulu 11" - value: "zulu_11" - wait: ~ if: build.source != "schedule" && build.source != "trigger_job" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 1efd34242..2414a75b5 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -5,7 +5,7 @@ "pipeline_slug": "logstash-pull-request-pipeline", "allow_org_users": true, "allowed_repo_permissions": ["admin", "write"], - "allowed_list": ["github-actions[bot]"], + "allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]", "elastic-vault-github-plugin-prod[bot]"], "set_commit_status": true, "build_on_commit": true, "build_on_comment": true, @@ -14,7 +14,11 @@ "skip_ci_labels": [ ], "skip_target_branches": [ ], "skip_ci_on_only_changed": [ - "^docs/" + "^.github/", + "^docs/", + "^.mergify.yml$", + "^.pre-commit-config.yaml", + "\\.md$" ], "always_require_ci_on_changed": [ ] } diff --git a/.buildkite/pull_request_pipeline.yml b/.buildkite/pull_request_pipeline.yml index 9209144da..a087813df 100644 --- a/.buildkite/pull_request_pipeline.yml +++ b/.buildkite/pull_request_pipeline.yml @@ -22,10 +22,12 @@ steps: - label: ":rspec: Ruby unit tests" key: "ruby-unit-tests" agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci" + image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci-no-root" cpu: "4" memory: "8Gi" ephemeralStorage: "100Gi" + # Run as a non-root user + imageUID: "1002" retry: automatic: - limit: 3 @@ -79,8 +81,8 @@ steps: manual: allowed: true - - label: ":lab_coat: Integration Tests / part 1" - key: "integration-tests-part-1" + - label: ":lab_coat: Integration Tests / part 1-of-3" + key: "integration-tests-part-1-of-3" agents: image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci-no-root" cpu: "8" @@ -95,10 +97,10 @@ steps: set -euo pipefail source .buildkite/scripts/common/container-agent.sh - ci/integration_tests.sh split 0 + ci/integration_tests.sh split 0 3 - - label: ":lab_coat: Integration Tests / part 2" - key: "integration-tests-part-2" + - label: ":lab_coat: Integration Tests / part 2-of-3" + key: "integration-tests-part-2-of-3" agents: image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci-no-root" cpu: "8" @@ -113,10 +115,28 @@ steps: set -euo pipefail source .buildkite/scripts/common/container-agent.sh - ci/integration_tests.sh split 1 + ci/integration_tests.sh split 1 3 - - label: ":lab_coat: IT Persistent Queues / part 1" - key: "integration-tests-qa-part-1" + - label: ":lab_coat: Integration Tests / part 3-of-3" + key: "integration-tests-part-3-of-3" + agents: + image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci-no-root" + cpu: "8" + memory: "16Gi" + ephemeralStorage: "100Gi" + # Run as a non-root user + imageUID: "1002" + retry: + automatic: + - limit: 3 + command: | + set -euo pipefail + + source .buildkite/scripts/common/container-agent.sh + ci/integration_tests.sh split 2 3 + + - label: ":lab_coat: IT Persistent Queues / part 1-of-3" + key: "integration-tests-qa-part-1-of-3" agents: image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci-no-root" cpu: "8" @@ -132,10 +152,10 @@ steps: source .buildkite/scripts/common/container-agent.sh export FEATURE_FLAG=persistent_queues - ci/integration_tests.sh split 0 + ci/integration_tests.sh split 0 3 - - label: ":lab_coat: IT Persistent Queues / part 2" - key: "integration-tests-qa-part-2" + - label: ":lab_coat: IT Persistent Queues / part 2-of-3" + key: "integration-tests-qa-part-2-of-3" agents: image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci-no-root" cpu: "8" @@ -151,7 +171,26 @@ steps: source .buildkite/scripts/common/container-agent.sh export FEATURE_FLAG=persistent_queues - ci/integration_tests.sh split 1 + ci/integration_tests.sh split 1 3 + + - label: ":lab_coat: IT Persistent Queues / part 3-of-3" + key: "integration-tests-qa-part-3-of-3" + agents: + image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci-no-root" + cpu: "8" + memory: "16Gi" + ephemeralStorage: "100Gi" + # Run as non root (logstash) user. UID is hardcoded in image. + imageUID: "1002" + retry: + automatic: + - limit: 3 + command: | + set -euo pipefail + + source .buildkite/scripts/common/container-agent.sh + export FEATURE_FLAG=persistent_queues + ci/integration_tests.sh split 2 3 - label: ":lab_coat: x-pack unit tests" key: "x-pack-unit-tests" diff --git a/.buildkite/scripts/benchmark/README.md b/.buildkite/scripts/benchmark/README.md new file mode 100644 index 000000000..63cc8dbac --- /dev/null +++ b/.buildkite/scripts/benchmark/README.md @@ -0,0 +1,22 @@ +## Steps to set up GCP instance to run benchmark script +- Create an instance "n2-standard-16" with Ubuntu image +- Install docker + - `sudo snap install docker` + - `sudo usermod -a -G docker $USER` +- Install jq +- Install vault + - `sudo snap install vault` + - `vault login --method github` + - `vault kv get -format json secret/ci/elastic-logstash/benchmark` +- Setup Elasticsearch index mapping and alias with `setup/*` +- Import Kibana dashboard with `save-objects/*` +- Run the benchmark script + - Send data to your own Elasticsearch. Customise `VAULT_PATH="secret/ci/elastic-logstash/your/path"` + - Run the script `main.sh` + - or run in background `nohup bash -x main.sh > log.log 2>&1 &` + +## Notes +- Benchmarks should only be compared using the same hardware setup. +- Please do not send the test metrics to the benchmark cluster. You can set `VAULT_PATH` to send data and metrics to your own server. +- Run `all.sh` as calibration which gives you a baseline of performance in different versions. +- [#16586](https://github.com/elastic/logstash/pull/16586) allows legacy monitoring using the configuration `xpack.monitoring.allow_legacy_collection: true`, which is not recognized in version 8. To run benchmarks in version 8, use the script of the corresponding branch (e.g. `8.16`) instead of `main` in buildkite. \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/config/filebeat.yml b/.buildkite/scripts/benchmark/config/filebeat.yml new file mode 100644 index 000000000..b7fb90fc8 --- /dev/null +++ b/.buildkite/scripts/benchmark/config/filebeat.yml @@ -0,0 +1,15 @@ +http.enabled: false +filebeat.inputs: +- type: log + symlinks: true + paths: + - "/usr/share/filebeat/flog/*.log" +logging.level: info +output.logstash: + hosts: + - "localhost:5044" + ttl: 10ms + bulk_max_size: 2048 +# queue.mem: +# events: 4096 +# flush.min_events: 2048 \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/config/logstash.yml b/.buildkite/scripts/benchmark/config/logstash.yml new file mode 100644 index 000000000..59d648889 --- /dev/null +++ b/.buildkite/scripts/benchmark/config/logstash.yml @@ -0,0 +1,10 @@ +api.http.host: 0.0.0.0 +pipeline.workers: ${WORKER} +pipeline.batch.size: ${BATCH_SIZE} +queue.type: ${QTYPE} + +xpack.monitoring.allow_legacy_collection: true +xpack.monitoring.enabled: true +xpack.monitoring.elasticsearch.username: ${MONITOR_ES_USER} +xpack.monitoring.elasticsearch.password: ${MONITOR_ES_PW} +xpack.monitoring.elasticsearch.hosts: ["${MONITOR_ES_HOST}"] diff --git a/.buildkite/scripts/benchmark/config/pipelines.yml b/.buildkite/scripts/benchmark/config/pipelines.yml new file mode 100644 index 000000000..dd0cbf8df --- /dev/null +++ b/.buildkite/scripts/benchmark/config/pipelines.yml @@ -0,0 +1,44 @@ +- pipeline.id: main + config.string: | + input { + beats { + port => 5044 + } + } + output { + elasticsearch { + hosts => [ "${BENCHMARK_ES_HOST}" ] + user => "${BENCHMARK_ES_USER}" + password => "${BENCHMARK_ES_PW}" + } + } +- pipeline.id: node_stats + config.string: | + input { + http_poller { + urls => { + NodeStats => { + method => get + url => "http://localhost:9600/_node/stats" + } + } + schedule => { every => "30s"} + codec => "json" + } + } + filter { + mutate { + remove_field => [ "host", "[pipelines][.monitoring-logstash]", "event" ] + add_field => { "[benchmark][label]" => "${QTYPE}_w${WORKER}b${BATCH_SIZE}" } + } + } + output { + elasticsearch { + hosts => [ "${BENCHMARK_ES_HOST}" ] + user => "${BENCHMARK_ES_USER}" + password => "${BENCHMARK_ES_PW}" + data_stream_type => "metrics" + data_stream_dataset => "nodestats" + data_stream_namespace => "logstash" + } + } \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/config/uuid b/.buildkite/scripts/benchmark/config/uuid new file mode 100644 index 000000000..b6ac241f7 --- /dev/null +++ b/.buildkite/scripts/benchmark/config/uuid @@ -0,0 +1 @@ +f74f1a28-25e9-494f-ba41-ca9f13d4446d \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/core.sh b/.buildkite/scripts/benchmark/core.sh new file mode 100755 index 000000000..130c937a6 --- /dev/null +++ b/.buildkite/scripts/benchmark/core.sh @@ -0,0 +1,315 @@ +#!/usr/bin/env bash +set -eo pipefail + +SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")" +CONFIG_PATH="$SCRIPT_PATH/config" +source "$SCRIPT_PATH/util.sh" + +usage() { + echo "Usage: $0 [FB_CNT] [QTYPE] [CPU] [MEM]" + echo "Example: $0 4 {persisted|memory|all} 2 2" + exit 1 +} + +parse_args() { + while [[ "$#" -gt 0 ]]; do + if [ -z "$FB_CNT" ]; then + FB_CNT=$1 + elif [ -z "$QTYPE" ]; then + case $1 in + all | persisted | memory) + QTYPE=$1 + ;; + *) + echo "Error: wrong queue type $1" + usage + ;; + esac + elif [ -z "$CPU" ]; then + CPU=$1 + elif [ -z "$MEM" ]; then + MEM=$1 + else + echo "Error: Too many arguments" + usage + fi + shift + done + + # set default value + # number of filebeat + FB_CNT=${FB_CNT:-4} + # all | persisted | memory + QTYPE=${QTYPE:-all} + CPU=${CPU:-4} + MEM=${MEM:-4} + XMX=$((MEM / 2)) + + IFS=',' + # worker multiplier: 1,2,4 + MULTIPLIERS="${MULTIPLIERS:-1,2,4}" + read -ra MULTIPLIERS <<< "$MULTIPLIERS" + BATCH_SIZES="${BATCH_SIZES:-500}" + read -ra BATCH_SIZES <<< "$BATCH_SIZES" + # tags to json array + read -ra TAG_ARRAY <<< "$TAGS" + JSON_TAGS=$(printf '"%s",' "${TAG_ARRAY[@]}" | sed 's/,$//') + JSON_TAGS="[$JSON_TAGS]" + + IFS=' ' + echo "filebeats: $FB_CNT, cpu: $CPU, mem: $MEM, Queue: $QTYPE, worker multiplier: ${MULTIPLIERS[@]}, batch size: ${BATCH_SIZES[@]}" +} + +get_secret() { + VAULT_PATH=${VAULT_PATH:-secret/ci/elastic-logstash/benchmark} + VAULT_DATA=$(vault kv get -format json $VAULT_PATH) + BENCHMARK_ES_HOST=$(echo $VAULT_DATA | jq -r '.data.es_host') + BENCHMARK_ES_USER=$(echo $VAULT_DATA | jq -r '.data.es_user') + BENCHMARK_ES_PW=$(echo $VAULT_DATA | jq -r '.data.es_pw') + + MONITOR_ES_HOST=$(echo $VAULT_DATA | jq -r '.data.monitor_es_host') + MONITOR_ES_USER=$(echo $VAULT_DATA | jq -r '.data.monitor_es_user') + MONITOR_ES_PW=$(echo $VAULT_DATA | jq -r '.data.monitor_es_pw') +} + +pull_images() { + echo "--- Pull docker images" + + if [[ -n "$LS_VERSION" ]]; then + # pull image if it doesn't exist in local + [[ -z $(docker images -q docker.elastic.co/logstash/logstash:$LS_VERSION) ]] && docker pull "docker.elastic.co/logstash/logstash:$LS_VERSION" + else + # pull the latest snapshot logstash image + # select the SNAPSHOT artifact with the highest semantic version number + LS_VERSION=$( curl --retry-all-errors --retry 5 --retry-delay 1 -s "https://storage.googleapis.com/artifacts-api/snapshots/main.json" | jq -r '.version' ) + BUILD_ID=$(curl --retry-all-errors --retry 5 --retry-delay 1 -s "https://storage.googleapis.com/artifacts-api/snapshots/main.json" | jq -r '.build_id') + ARCH=$(arch) + IMAGE_URL="https://snapshots.elastic.co/${BUILD_ID}/downloads/logstash/logstash-$LS_VERSION-docker-image-$ARCH.tar.gz" + IMAGE_FILENAME="$LS_VERSION.tar.gz" + + echo "Download $LS_VERSION from $IMAGE_URL" + [[ ! -e $IMAGE_FILENAME ]] && curl -fsSL --retry-max-time 60 --retry 3 --retry-delay 5 -o "$IMAGE_FILENAME" "$IMAGE_URL" + [[ -z $(docker images -q docker.elastic.co/logstash/logstash:$LS_VERSION) ]] && docker load -i "$IMAGE_FILENAME" + fi + + # pull filebeat image + FB_DEFAULT_VERSION="8.13.4" + FB_VERSION=${FB_VERSION:-$FB_DEFAULT_VERSION} + docker pull "docker.elastic.co/beats/filebeat:$FB_VERSION" +} + +generate_logs() { + FLOG_FILE_CNT=${FLOG_FILE_CNT:-4} + SINGLE_SIZE=524288000 + TOTAL_SIZE="$((FLOG_FILE_CNT * SINGLE_SIZE))" + FLOG_PATH="$SCRIPT_PATH/flog" + mkdir -p $FLOG_PATH + + if [[ ! -e "$FLOG_PATH/log${FLOG_FILE_CNT}.log" ]]; then + echo "--- Generate logs in background. log: ${FLOG_FILE_CNT}, each size: 500mb" + docker run -d --name=flog --rm -v $FLOG_PATH:/go/src/data mingrammer/flog -t log -w -o "/go/src/data/log.log" -b $TOTAL_SIZE -p $SINGLE_SIZE + fi +} + +check_logs() { + echo "--- Check log generation" + + local cnt=0 + until [[ -e "$FLOG_PATH/log${FLOG_FILE_CNT}.log" || $cnt -gt 600 ]]; do + echo "wait 30s" && sleep 30 + cnt=$((cnt + 30)) + done + + ls -lah $FLOG_PATH +} + +start_logstash() { + LS_CONFIG_PATH=$SCRIPT_PATH/ls/config + mkdir -p $LS_CONFIG_PATH + + cp $CONFIG_PATH/pipelines.yml $LS_CONFIG_PATH/pipelines.yml + cp $CONFIG_PATH/logstash.yml $LS_CONFIG_PATH/logstash.yml + cp $CONFIG_PATH/uuid $LS_CONFIG_PATH/uuid + + LS_JAVA_OPTS=${LS_JAVA_OPTS:--Xmx${XMX}g} + docker run -d --name=ls --net=host --cpus=$CPU --memory=${MEM}g -e LS_JAVA_OPTS="$LS_JAVA_OPTS" \ + -e QTYPE="$QTYPE" -e WORKER="$WORKER" -e BATCH_SIZE="$BATCH_SIZE" \ + -e BENCHMARK_ES_HOST="$BENCHMARK_ES_HOST" -e BENCHMARK_ES_USER="$BENCHMARK_ES_USER" -e BENCHMARK_ES_PW="$BENCHMARK_ES_PW" \ + -e MONITOR_ES_HOST="$MONITOR_ES_HOST" -e MONITOR_ES_USER="$MONITOR_ES_USER" -e MONITOR_ES_PW="$MONITOR_ES_PW" \ + -v $LS_CONFIG_PATH/logstash.yml:/usr/share/logstash/config/logstash.yml:ro \ + -v $LS_CONFIG_PATH/pipelines.yml:/usr/share/logstash/config/pipelines.yml:ro \ + -v $LS_CONFIG_PATH/uuid:/usr/share/logstash/data/uuid:ro \ + docker.elastic.co/logstash/logstash:$LS_VERSION +} + +start_filebeat() { + for ((i = 0; i < FB_CNT; i++)); do + FB_PATH="$SCRIPT_PATH/fb${i}" + mkdir -p $FB_PATH + + cp $CONFIG_PATH/filebeat.yml $FB_PATH/filebeat.yml + + docker run -d --name=fb$i --net=host --user=root \ + -v $FB_PATH/filebeat.yml:/usr/share/filebeat/filebeat.yml \ + -v $SCRIPT_PATH/flog:/usr/share/filebeat/flog \ + docker.elastic.co/beats/filebeat:$FB_VERSION filebeat -e --strict.perms=false + done +} + +capture_stats() { + CURRENT=$(jq -r '.flow.output_throughput.current' $NS_JSON) + local eps_1m=$(jq -r '.flow.output_throughput.last_1_minute' $NS_JSON) + local eps_5m=$(jq -r '.flow.output_throughput.last_5_minutes' $NS_JSON) + local worker_util=$(jq -r '.pipelines.main.flow.worker_utilization.last_1_minute' $NS_JSON) + local worker_concurr=$(jq -r '.pipelines.main.flow.worker_concurrency.last_1_minute' $NS_JSON) + local cpu_percent=$(jq -r '.process.cpu.percent' $NS_JSON) + local heap=$(jq -r '.jvm.mem.heap_used_in_bytes' $NS_JSON) + local non_heap=$(jq -r '.jvm.mem.non_heap_used_in_bytes' $NS_JSON) + local q_event_cnt=$(jq -r '.pipelines.main.queue.events_count' $NS_JSON) + local q_size=$(jq -r '.pipelines.main.queue.queue_size_in_bytes' $NS_JSON) + TOTAL_EVENTS_OUT=$(jq -r '.pipelines.main.events.out' $NS_JSON) + printf "current: %s, 1m: %s, 5m: %s, worker_utilization: %s, worker_concurrency: %s, cpu: %s, heap: %s, non-heap: %s, q_events: %s, q_size: %s, total_events_out: %s\n" \ + $CURRENT $eps_1m $eps_5m $worker_util $worker_concurr $cpu_percent $heap $non_heap $q_event_cnt $q_size $TOTAL_EVENTS_OUT +} + +aggregate_stats() { + local file_glob="$SCRIPT_PATH/$NS_DIR/${QTYPE:0:1}_w${WORKER}b${BATCH_SIZE}_*.json" + MAX_EPS_1M=$( jqmax '.flow.output_throughput.last_1_minute' "$file_glob" ) + MAX_EPS_5M=$( jqmax '.flow.output_throughput.last_5_minutes' "$file_glob" ) + MAX_WORKER_UTIL=$( jqmax '.pipelines.main.flow.worker_utilization.last_1_minute' "$file_glob" ) + MAX_WORKER_CONCURR=$( jqmax '.pipelines.main.flow.worker_concurrency.last_1_minute' "$file_glob" ) + MAX_Q_EVENT_CNT=$( jqmax '.pipelines.main.queue.events_count' "$file_glob" ) + MAX_Q_SIZE=$( jqmax '.pipelines.main.queue.queue_size_in_bytes' "$file_glob" ) + + AVG_CPU_PERCENT=$( jqavg '.process.cpu.percent' "$file_glob" ) + AVG_VIRTUAL_MEM=$( jqavg '.process.mem.total_virtual_in_bytes' "$file_glob" ) + AVG_HEAP=$( jqavg '.jvm.mem.heap_used_in_bytes' "$file_glob" ) + AVG_NON_HEAP=$( jqavg '.jvm.mem.non_heap_used_in_bytes' "$file_glob" ) +} + +send_summary() { + echo "--- Send summary to Elasticsearch" + + # build json + local timestamp + timestamp=$(date -u +"%Y-%m-%dT%H:%M:%S") + SUMMARY="{\"timestamp\": \"$timestamp\", \"version\": \"$LS_VERSION\", \"cpu\": \"$CPU\", \"mem\": \"$MEM\", \"workers\": \"$WORKER\", \"batch_size\": \"$BATCH_SIZE\", \"queue_type\": \"$QTYPE\"" + not_empty "$TOTAL_EVENTS_OUT" && SUMMARY="$SUMMARY, \"total_events_out\": \"$TOTAL_EVENTS_OUT\"" + not_empty "$MAX_EPS_1M" && SUMMARY="$SUMMARY, \"max_eps_1m\": \"$MAX_EPS_1M\"" + not_empty "$MAX_EPS_5M" && SUMMARY="$SUMMARY, \"max_eps_5m\": \"$MAX_EPS_5M\"" + not_empty "$MAX_WORKER_UTIL" && SUMMARY="$SUMMARY, \"max_worker_utilization\": \"$MAX_WORKER_UTIL\"" + not_empty "$MAX_WORKER_CONCURR" && SUMMARY="$SUMMARY, \"max_worker_concurrency\": \"$MAX_WORKER_CONCURR\"" + not_empty "$AVG_CPU_PERCENT" && SUMMARY="$SUMMARY, \"avg_cpu_percentage\": \"$AVG_CPU_PERCENT\"" + not_empty "$AVG_HEAP" && SUMMARY="$SUMMARY, \"avg_heap\": \"$AVG_HEAP\"" + not_empty "$AVG_NON_HEAP" && SUMMARY="$SUMMARY, \"avg_non_heap\": \"$AVG_NON_HEAP\"" + not_empty "$AVG_VIRTUAL_MEM" && SUMMARY="$SUMMARY, \"avg_virtual_memory\": \"$AVG_VIRTUAL_MEM\"" + not_empty "$MAX_Q_EVENT_CNT" && SUMMARY="$SUMMARY, \"max_queue_events\": \"$MAX_Q_EVENT_CNT\"" + not_empty "$MAX_Q_SIZE" && SUMMARY="$SUMMARY, \"max_queue_bytes_size\": \"$MAX_Q_SIZE\"" + not_empty "$TAGS" && SUMMARY="$SUMMARY, \"tags\": $JSON_TAGS" + SUMMARY="$SUMMARY}" + + tee summary.json << EOF +{"index": {}} +$SUMMARY +EOF + + # send to ES + local resp + local err_status + resp=$(curl -s -X POST -u "$BENCHMARK_ES_USER:$BENCHMARK_ES_PW" "$BENCHMARK_ES_HOST/benchmark_summary/_bulk" -H 'Content-Type: application/json' --data-binary @"summary.json") + echo "$resp" + err_status=$(echo "$resp" | jq -r ".errors") + if [[ "$err_status" == "true" ]]; then + echo "Failed to send summary" + exit 1 + fi +} + +# $1: snapshot index +node_stats() { + NS_JSON="$SCRIPT_PATH/$NS_DIR/${QTYPE:0:1}_w${WORKER}b${BATCH_SIZE}_$1.json" # m_w8b1000_0.json + + # curl inside container because docker on mac cannot resolve localhost to host network interface + docker exec -i ls curl localhost:9600/_node/stats > "$NS_JSON" 2> /dev/null +} + +# $1: index +snapshot() { + node_stats $1 + capture_stats +} + +create_directory() { + NS_DIR="fb${FB_CNT}c${CPU}m${MEM}" # fb4c4m4 + mkdir -p "$SCRIPT_PATH/$NS_DIR" +} + +queue() { + for QTYPE in "persisted" "memory"; do + worker + done +} + +worker() { + for m in "${MULTIPLIERS[@]}"; do + WORKER=$((CPU * m)) + batch + done +} + +batch() { + for BATCH_SIZE in "${BATCH_SIZES[@]}"; do + run_pipeline + stop_pipeline + done +} + +run_pipeline() { + echo "--- Run pipeline. queue type: $QTYPE, worker: $WORKER, batch size: $BATCH_SIZE" + + start_logstash + start_filebeat + docker ps + + echo "(0) sleep 3m" && sleep 180 + snapshot "0" + + for i in {1..8}; do + echo "($i) sleep 30s" && sleep 30 + snapshot "$i" + + # print docker log when ingestion rate is zero + # remove '.' in number and return max val + [[ $(max -g "${CURRENT/./}" "0") -eq 0 ]] && + docker logs fb0 && + docker logs ls + done + + aggregate_stats + send_summary +} + +stop_pipeline() { + echo "--- Stop Pipeline" + + for ((i = 0; i < FB_CNT; i++)); do + docker stop fb$i + docker rm fb$i + done + + docker stop ls + docker rm ls + + curl -u "$BENCHMARK_ES_USER:$BENCHMARK_ES_PW" -X DELETE $BENCHMARK_ES_HOST/_data_stream/logs-generic-default + echo " data stream deleted " + + # TODO: clean page caches, reduce memory fragmentation + # https://github.com/elastic/logstash/pull/16191#discussion_r1647050216 +} + +clean_up() { + # stop log generation if it has not done yet + [[ -n $(docker ps | grep flog) ]] && docker stop flog || true + # remove image + docker image rm docker.elastic.co/logstash/logstash:$LS_VERSION +} diff --git a/.buildkite/scripts/benchmark/main.sh b/.buildkite/scripts/benchmark/main.sh new file mode 100755 index 000000000..3d615fcb4 --- /dev/null +++ b/.buildkite/scripts/benchmark/main.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +set -eo pipefail + +# ******************************************************* +# This script does benchmark by running Filebeats (docker) -> Logstash (docker) -> ES Cloud. +# Logstash metrics and benchmark results are sent to the same ES Cloud. +# Highlights: +# - Use flog (docker) to generate ~2GB log +# - Pull the snapshot docker image of the main branch every day +# - Logstash runs two pipelines, main and node_stats +# - The main pipeline handles beats ingestion, sending data to the data stream `logs-generic-default` +# - It runs for all combinations. (pq + mq) x worker x batch size +# - Each test runs for ~7 minutes +# - The node_stats pipeline retrieves Logstash /_node/stats every 30s and sends it to the data stream `metrics-nodestats-logstash` +# - The script sends a summary of EPS and resource usage to index `benchmark_summary` +# ******************************************************* + +SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")" +source "$SCRIPT_PATH/core.sh" + +## usage: +## main.sh FB_CNT QTYPE CPU MEM +## main.sh 4 all 4 4 # default launch 4 filebeats to benchmark pq and mq +## main.sh 4 memory +## main.sh 4 persisted +## main.sh 4 +## main.sh +## accept env vars: +## FB_VERSION=8.13.4 # docker tag +## LS_VERSION=8.15.0-SNAPSHOT # docker tag +## LS_JAVA_OPTS=-Xmx2g # by default, Xmx is set to half of memory +## MULTIPLIERS=1,2,4 # determine the number of workers (cpu * multiplier) +## BATCH_SIZES=125,500 +## CPU=4 # number of cpu for Logstash container +## MEM=4 # number of GB for Logstash container +## QTYPE=memory # queue type to test {persisted|memory|all} +## FB_CNT=4 # number of filebeats to use in benchmark +## FLOG_FILE_CNT=4 # number of files to generate for ingestion +## VAULT_PATH=secret/path # vault path point to Elasticsearch credentials. The default value points to benchmark cluster. +## TAGS=test,other # tags with "," separator. +main() { + parse_args "$@" + get_secret + + generate_logs + pull_images + check_logs + + create_directory + if [[ $QTYPE == "all" ]]; then + queue + else + worker + fi + + clean_up +} + +main "$@" \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/marathon.sh b/.buildkite/scripts/benchmark/marathon.sh new file mode 100755 index 000000000..eecbc7d8e --- /dev/null +++ b/.buildkite/scripts/benchmark/marathon.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -eo pipefail + +# ******************************************************* +# Run benchmark for versions that have flow metrics +# When the hardware changes, run the marathon task to establish a new baseline. +# Usage: +# nohup bash -x all.sh > log.log 2>&1 & +# Accept env vars: +# STACK_VERSIONS=8.15.0,8.15.1,8.16.0-SNAPSHOT # versions to test. It is comma separator string +# ******************************************************* + +SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")" +source "$SCRIPT_PATH/core.sh" + +parse_stack_versions() { + IFS=',' + STACK_VERSIONS="${STACK_VERSIONS:-8.6.0,8.7.0,8.8.0,8.9.0,8.10.0,8.11.0,8.12.0,8.13.0,8.14.0,8.15.0}" + read -ra STACK_VERSIONS <<< "$STACK_VERSIONS" +} + +main() { + parse_stack_versions + parse_args "$@" + get_secret + generate_logs + check_logs + + USER_QTYPE="$QTYPE" + + for V in "${STACK_VERSIONS[@]}" ; do + LS_VERSION="$V" + QTYPE="$USER_QTYPE" + pull_images + create_directory + if [[ $QTYPE == "all" ]]; then + queue + else + worker + fi + done +} + +main "$@" \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/save-objects/CHANGELOG.md b/.buildkite/scripts/benchmark/save-objects/CHANGELOG.md new file mode 100644 index 000000000..75a297e75 --- /dev/null +++ b/.buildkite/scripts/benchmark/save-objects/CHANGELOG.md @@ -0,0 +1,8 @@ +## 20241210 +Remove scripted field `5m_num` from dashboards + +## 20240912 +Updated runtime field `release` to return `true` when `version` contains "SNAPSHOT" + +## 20240912 +Initial dashboards \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/save-objects/README.md b/.buildkite/scripts/benchmark/save-objects/README.md new file mode 100644 index 000000000..264207618 --- /dev/null +++ b/.buildkite/scripts/benchmark/save-objects/README.md @@ -0,0 +1,14 @@ +benchmark_objects.ndjson contains the following resources + +- Dashboards + - daily snapshot + - released versions +- Data Views + - benchmark + - runtime fields + - | Fields Name | Type | Comment | + |--------------|---------------------------------------------------------------------------------------|--------------------------------------------------| + | versions_num | long | convert semantic versioning to number for graph sorting | + | release | boolean | `true` for released version. `false` for snapshot version. It is for graph filtering. | + +To import objects to Kibana, navigate to Stack Management > Save Objects and click Import \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/save-objects/benchmark_objects.ndjson b/.buildkite/scripts/benchmark/save-objects/benchmark_objects.ndjson new file mode 100644 index 000000000..32bdf55cc --- /dev/null +++ b/.buildkite/scripts/benchmark/save-objects/benchmark_objects.ndjson @@ -0,0 +1,31 @@ +{"attributes":{"allowHidden":false,"fieldAttrs":"{\"5m_num\":{\"customLabel\":\"\"},\"avg_heap_num\":{\"customLabel\":\"\"},\"avg_non_heap_num\":{\"customLabel\":\"\"},\"max_worker_utilization_num\":{\"customLabel\":\"\"},\"max_worker_concurrency_num\":{\"customLabel\":\"\"},\"max_queue_events\":{\"customLabel\":\"\"},\"max_queue_events_num\":{\"customLabel\":\"\"},\"total_events_out_num\":{\"customLabel\":\"\"},\"avg_cpu_percentage_num\":{\"customLabel\":\"\"},\"release\":{},\"version_num\":{}}","fieldFormatMap":"{\"5m_num\":{\"id\":\"number\",\"params\":{\"pattern\":\"0\"}},\"avg_heap_num\":{\"id\":\"number\"},\"avg_non_heap_num\":{\"id\":\"number\"},\"max_worker_utilization_num\":{\"id\":\"number\"},\"max_worker_concurrency_num\":{\"id\":\"number\"},\"max_queue_events\":{\"id\":\"number\"},\"max_queue_events_num\":{\"id\":\"number\"},\"avg_cpu_percentage_num\":{\"id\":\"number\"}}","fields":"[{\"name\":\"5m_num\",\"script\":\"return Integer.parseInt(doc['max_eps_5m.keyword'].value)\",\"lang\":\"painless\",\"type\":\"number\",\"scripted\":true,\"customLabel\":\"\"}]","name":"benchmark","runtimeFieldMap":"{\"release\":{\"type\":\"boolean\",\"script\":{\"source\":\"def version = doc['version.keyword'].value;\\nif (version.contains(\\\"SNAPSHOT\\\")) {\\n\\temit(false);\\n}\\nelse {\\n\\temit(true);\\n}\"}},\"version_num\":{\"type\":\"long\",\"script\":{\"source\":\"if (doc.containsKey('version.keyword') && !doc['version.keyword'].empty) {\\n // Get the version string\\n String version = doc['version.keyword'].value;\\n \\n // Remove any suffix after the patch number (e.g., -SNAPSHOT)\\n int dashIndex = version.indexOf('-');\\n if (dashIndex != -1) {\\n version = version.substring(0, dashIndex);\\n }\\n \\n // Find positions of dots\\n int firstDot = version.indexOf('.');\\n int secondDot = version.indexOf('.', firstDot + 1);\\n \\n // Extract major, minor, and patch parts of the version\\n int major = Integer.parseInt(version.substring(0, firstDot));\\n int minor = Integer.parseInt(version.substring(firstDot + 1, secondDot));\\n int patch = Integer.parseInt(version.substring(secondDot + 1));\\n \\n // Combine into a sortable numeric value\\n emit(major * 10000 + minor * 100 + patch);\\n}\\n\\nemit(0);\"}}}","sourceFilters":"[]","timeFieldName":"timestamp","title":"benchmark_*"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"c5493557-3fd6-4929-8dc2-40d248303942","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2024-09-12T20:34:35.037Z","updated_by":"u_4132377203_cloud","version":"WzE1NjYsOF0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","16dcf8b0-378f-48df-8bb3-f537324eea46","cc8c1413-0ccc-4109-a6c3-0c910eff776e","2c32a023-462c-4205-b462-6a87182732e4"],"columns":{"16dcf8b0-378f-48df-8bb3-f537324eea46":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"2c32a023-462c-4205-b462-6a87182732e4":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"non_heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_non_heap"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_heap"},"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3":{"dataType":"number","isBucketed":true,"label":"Top 10 values of workers","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"secondaryFields":[],"size":10},"scale":"ordinal","sourceField":"workers"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"893cd07c-e480-4dc1-9109-c6ebf926f0bf","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e","2c32a023-462c-4205-b462-6a87182732e4"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","xAccessor":"16dcf8b0-378f-48df-8bb3-f537324eea46"}],"legend":{"horizontalAlignment":"left","isInside":false,"isVisible":true,"position":"right","verticalAlignment":"bottom"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"jvm heap / non heap"}},"title":"[MQ] memory by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T13:24:44.067Z","created_by":"u_4132377203_cloud","id":"f5104988-461c-4f65-b31d-ed22d04cb6b8","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"893cd07c-e480-4dc1-9109-c6ebf926f0bf","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T13:24:44.067Z","updated_by":"u_4132377203_cloud","version":"WzE3OTAsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","16dcf8b0-378f-48df-8bb3-f537324eea46","cc8c1413-0ccc-4109-a6c3-0c910eff776e","0ad565fc-0a55-492b-ba69-1be57f501e13"],"columns":{"0ad565fc-0a55-492b-ba69-1be57f501e13":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"non_heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_non_heap"},"16dcf8b0-378f-48df-8bb3-f537324eea46":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_heap"},"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3":{"dataType":"number","isBucketed":true,"label":"Top 10 values of workers","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"secondaryFields":[],"size":10},"scale":"ordinal","sourceField":"workers"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"74d4500c-b3ea-4cd1-9c8c-6b4852a4baf4","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e","0ad565fc-0a55-492b-ba69-1be57f501e13"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","xAccessor":"16dcf8b0-378f-48df-8bb3-f537324eea46"}],"legend":{"horizontalAlignment":"left","isInside":false,"isVisible":true,"position":"right","verticalAlignment":"bottom"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"jvm heap / non heap"}},"title":"[PQ] memory by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T13:24:31.401Z","created_by":"u_4132377203_cloud","id":"4d1f7bef-c184-4457-b159-465128d2d70b","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"74d4500c-b3ea-4cd1-9c8c-6b4852a4baf4","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T13:24:31.401Z","updated_by":"u_4132377203_cloud","version":"WzE3ODksOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","16dcf8b0-378f-48df-8bb3-f537324eea46","cc8c1413-0ccc-4109-a6c3-0c910eff776e","2c32a023-462c-4205-b462-6a87182732e4"],"columns":{"16dcf8b0-378f-48df-8bb3-f537324eea46":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"2c32a023-462c-4205-b462-6a87182732e4":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"non_heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_non_heap"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_heap"},"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3":{"dataType":"number","isBucketed":true,"label":"Top 10 values of workers","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"secondaryFields":[],"size":10},"scale":"ordinal","sourceField":"workers"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"a3c80a6b-82a1-4a58-9832-16f1ff9d2ac4","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":"release : true "},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e","2c32a023-462c-4205-b462-6a87182732e4"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","xAccessor":"16dcf8b0-378f-48df-8bb3-f537324eea46"}],"legend":{"horizontalAlignment":"left","isInside":false,"isVisible":true,"position":"right","verticalAlignment":"bottom"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"jvm heap / non heap"}},"title":"[PQ][R] memory by worker ","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T13:24:22.412Z","created_by":"u_4132377203_cloud","id":"72ae6cc9-47cd-4b51-b441-86905c2b92bd","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"a3c80a6b-82a1-4a58-9832-16f1ff9d2ac4","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T13:24:22.412Z","updated_by":"u_4132377203_cloud","version":"WzE3ODgsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","16dcf8b0-378f-48df-8bb3-f537324eea46","cc8c1413-0ccc-4109-a6c3-0c910eff776e","2c32a023-462c-4205-b462-6a87182732e4"],"columns":{"16dcf8b0-378f-48df-8bb3-f537324eea46":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"2c32a023-462c-4205-b462-6a87182732e4":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"non_heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_non_heap"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"heap","operationType":"median","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"scale":"ratio","sourceField":"avg_heap"},"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3":{"dataType":"number","isBucketed":true,"label":"Top 10 values of workers","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"secondaryFields":[],"size":10},"scale":"ordinal","sourceField":"workers"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"7c4a3d0f-46e7-4d19-bde0-0ea79a3cbdd9","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":"release : true "},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e","2c32a023-462c-4205-b462-6a87182732e4"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"e7fa90f9-5d12-46d7-a62d-d6a77e6b2bd3","xAccessor":"16dcf8b0-378f-48df-8bb3-f537324eea46"}],"legend":{"horizontalAlignment":"left","isInside":false,"isVisible":true,"position":"right","verticalAlignment":"bottom"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"jvm heap / non heap"}},"title":"[MQ][R] memory by worker ","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T13:24:09.653Z","created_by":"u_4132377203_cloud","id":"a577558f-f9a6-4c86-b562-7618b2c71db0","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"7c4a3d0f-46e7-4d19-bde0-0ea79a3cbdd9","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T13:24:09.653Z","updated_by":"u_4132377203_cloud","version":"WzE3ODcsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_eps_5m","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_eps_5m"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"8963247c-0194-4916-8a2b-e121fefbb4b3","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"endValue":"None","fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","legendStats":[],"position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"5m eps"}},"title":"[PQ] EPS by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T11:50:10.083Z","created_by":"u_4132377203_cloud","id":"f24fc69c-7714-40d3-b34e-3d90fa9b7023","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"8963247c-0194-4916-8a2b-e121fefbb4b3","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T11:50:10.083Z","updated_by":"u_4132377203_cloud","version":"WzE3ODEsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"customLabel":false,"dataType":"number","isBucketed":false,"label":"Median of max_eps_5m","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_eps_5m"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"index":"8171fdc1-2ff4-4f45-8796-dffd31749c63","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"endValue":"None","fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","legendStats":[],"position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"5m eps"}},"title":"[MQ] EPS by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T11:49:58.528Z","created_by":"u_4132377203_cloud","id":"5c7f9518-5dac-4a3f-b8e1-6ece4135a8be","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T11:49:58.528Z","updated_by":"u_4132377203_cloud","version":"WzE3ODAsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"999c9564-cba1-4f3b-af99-ccbacb8e034f":{"columnOrder":["a58f8c48-c2a7-4fc6-b54e-716bf4ca001e","9ddc0f02-5530-4930-99bd-2a914ada1b8f","be033d18-2c04-44f2-b403-0b88d888143d"],"columns":{"9ddc0f02-5530-4930-99bd-2a914ada1b8f":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e":{"dataType":"string","isBucketed":true,"label":"Top values of workers.keyword + 1 other","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"be033d18-2c04-44f2-b403-0b88d888143d","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"multi_terms"},"secondaryFields":["queue_type.keyword"],"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"be033d18-2c04-44f2-b403-0b88d888143d":{"dataType":"number","isBucketed":false,"label":"Median of max_eps_5m","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_eps_5m"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"release","index":"6feecd96-2840-4a20-bb3c-73837932d9ff","key":"release","negate":false,"params":{"query":false},"type":"phrase"},"query":{"match_phrase":{"release":false}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["be033d18-2c04-44f2-b403-0b88d888143d"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["4","memory"]]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["8","memory"]]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["16","memory"]]},"touched":false},{"color":{"colorCode":"#5e6c94","type":"colorCode"},"rule":{"type":"matchExactly","values":[["8","persisted"]]},"touched":true},{"color":{"colorIndex":4,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["16","persisted"]]},"touched":false},{"color":{"colorCode":"#a0df7b","type":"colorCode"},"rule":{"type":"matchExactly","values":[["4","persisted"]]},"touched":true}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"999c9564-cba1-4f3b-af99-ccbacb8e034f","layerType":"data","seriesType":"line","splitAccessor":"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e","xAccessor":"9ddc0f02-5530-4930-99bd-2a914ada1b8f"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"5m eps"}},"title":"Daily EPS by worker & queue","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T11:48:00.951Z","created_by":"u_4132377203_cloud","id":"94ae4c78-8004-4abb-80c9-271f37c94cdc","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-999c9564-cba1-4f3b-af99-ccbacb8e034f","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"6feecd96-2840-4a20-bb3c-73837932d9ff","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T11:48:00.951Z","updated_by":"u_4132377203_cloud","version":"WzE3NzUsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"currentIndexPatternId":"c5493557-3fd6-4929-8dc2-40d248303942","layers":{"999c9564-cba1-4f3b-af99-ccbacb8e034f":{"columnOrder":["a58f8c48-c2a7-4fc6-b54e-716bf4ca001e","9ddc0f02-5530-4930-99bd-2a914ada1b8f","be033d18-2c04-44f2-b403-0b88d888143d"],"columns":{"9ddc0f02-5530-4930-99bd-2a914ada1b8f":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e":{"dataType":"string","isBucketed":true,"label":"Top values of workers.keyword + 1 other","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"be033d18-2c04-44f2-b403-0b88d888143d","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"multi_terms"},"secondaryFields":["queue_type.keyword"],"size":100},"scale":"ordinal","sourceField":"workers.keyword"},"be033d18-2c04-44f2-b403-0b88d888143d":{"dataType":"number","isBucketed":false,"label":"Median of max_eps_5m","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_eps_5m"}},"incompleteColumns":{},"indexPatternId":"c5493557-3fd6-4929-8dc2-40d248303942","sampling":1}}},"indexpattern":{"currentIndexPatternId":"c5493557-3fd6-4929-8dc2-40d248303942","layers":{}},"textBased":{"indexPatternRefs":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","timeField":"timestamp","title":"benchmark_*"}],"layers":{}}},"filters":[],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["be033d18-2c04-44f2-b403-0b88d888143d"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["4","memory"]]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["8","memory"]]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["16","memory"]]},"touched":false},{"color":{"colorCode":"#5e6c94","type":"colorCode"},"rule":{"type":"matchExactly","values":[["8","persisted"]]},"touched":true},{"color":{"colorIndex":4,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":[["16","persisted"]]},"touched":false},{"color":{"colorCode":"#a0df7b","type":"colorCode"},"rule":{"type":"matchExactly","values":[["4","persisted"]]},"touched":true}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"999c9564-cba1-4f3b-af99-ccbacb8e034f","layerType":"data","seriesType":"line","splitAccessor":"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e","xAccessor":"9ddc0f02-5530-4930-99bd-2a914ada1b8f"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yTitle":"5m eps"}},"title":"Release EPS by worker & queue","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-10-24T11:46:07.298Z","created_by":"u_4132377203_cloud","id":"2c017667-7403-402c-b027-3cc790945a27","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-999c9564-cba1-4f3b-af99-ccbacb8e034f","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-10-24T11:46:07.298Z","updated_by":"u_4132377203_cloud","version":"WzE3NjQsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_concurrency","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_concurrency"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"7edb6dc9-8b2b-47ec-be64-bae2a4958cc9","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_concurrency"}},"title":"[MQ][R] Worker Concurrency by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-11T09:53:13.413Z","id":"9546a73b-5937-4d3d-850f-30625d6e1405","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"7edb6dc9-8b2b-47ec-be64-bae2a4958cc9","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-11T09:53:13.413Z","version":"WzEzOTEsN10="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of total_events_out","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"total_events_out"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"2786f33f-2ad1-4722-8706-9cba9613662e","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"total events out"}},"title":"[MQ][R] total events out by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-11T09:53:00.945Z","id":"6fba7dff-2564-450b-b885-8c6cf97fa727","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"2786f33f-2ad1-4722-8706-9cba9613662e","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-11T09:53:00.945Z","version":"WzEzODksN10="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_concurrency","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_concurrency"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"a22f82f6-c7b8-4e06-b2f5-69e25c5aefc4","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_concurrency"}},"title":"[PQ][R] Worker Concurrency by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-11T09:51:52.744Z","id":"661cb795-bb69-4599-8c4b-a4798ef69dc6","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"a22f82f6-c7b8-4e06-b2f5-69e25c5aefc4","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-11T09:51:52.744Z","version":"WzEzODAsN10="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_queue_events","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_queue_events"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"48ba7011-43c1-48fc-bc36-858bcec74547","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"events in queue"}},"title":"[PQ][R] events in queue by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-11T09:51:43.703Z","id":"d79b8742-6284-4842-ac44-65640d090179","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"48ba7011-43c1-48fc-bc36-858bcec74547","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-11T09:51:43.703Z","version":"WzEzNzgsN10="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of total_events_out","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"total_events_out"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"d556c1f1-16ab-45de-adda-366de4703635","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"total events out"}},"title":"[PQ][R] total events out by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-11T09:52:31.089Z","id":"1872e84f-56f2-4a17-9426-3d25d6e03931","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"d556c1f1-16ab-45de-adda-366de4703635","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-11T09:52:31.089Z","version":"WzEzODQsN10="} +{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[{\"meta\":{\"disabled\":false,\"negate\":false,\"alias\":null,\"key\":\"release\",\"field\":\"release\",\"params\":{\"query\":true},\"type\":\"phrase\",\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"query\":{\"match_phrase\":{\"release\":true}},\"$state\":{\"store\":\"appState\"}}]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"syncCursor\":true,\"syncTooltips\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":19,\"i\":\"329684df-6ec4-4973-8c96-bc91eaa23fe9\"},\"panelIndex\":\"329684df-6ec4-4973-8c96-bc91eaa23fe9\",\"embeddableConfig\":{\"enhancements\":{},\"attributes\":{\"title\":\"Release EPS by worker & queue\",\"description\":\"\",\"visualizationType\":\"lnsXY\",\"state\":{\"visualization\":{\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"fittingFunction\":\"Linear\",\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"layers\":[{\"accessors\":[\"be033d18-2c04-44f2-b403-0b88d888143d\"],\"colorMapping\":{\"assignments\":[{\"color\":{\"colorIndex\":0,\"paletteId\":\"eui_amsterdam_color_blind\",\"type\":\"categorical\"},\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"4\",\"memory\"]]},\"touched\":false},{\"color\":{\"colorIndex\":1,\"paletteId\":\"eui_amsterdam_color_blind\",\"type\":\"categorical\"},\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"8\",\"memory\"]]},\"touched\":false},{\"color\":{\"colorIndex\":2,\"paletteId\":\"eui_amsterdam_color_blind\",\"type\":\"categorical\"},\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"16\",\"memory\"]]},\"touched\":false},{\"color\":{\"colorCode\":\"#5e6c94\",\"type\":\"colorCode\"},\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"8\",\"persisted\"]]},\"touched\":true},{\"color\":{\"colorIndex\":4,\"paletteId\":\"eui_amsterdam_color_blind\",\"type\":\"categorical\"},\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"16\",\"persisted\"]]},\"touched\":false},{\"color\":{\"colorCode\":\"#a0df7b\",\"type\":\"colorCode\"},\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"4\",\"persisted\"]]},\"touched\":true}],\"colorMode\":{\"type\":\"categorical\"},\"paletteId\":\"eui_amsterdam_color_blind\",\"specialAssignments\":[{\"color\":{\"type\":\"loop\"},\"rule\":{\"type\":\"other\"},\"touched\":false}]},\"layerId\":\"999c9564-cba1-4f3b-af99-ccbacb8e034f\",\"layerType\":\"data\",\"seriesType\":\"line\",\"splitAccessor\":\"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e\",\"xAccessor\":\"9ddc0f02-5530-4930-99bd-2a914ada1b8f\"}],\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"preferredSeriesType\":\"line\",\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"valueLabels\":\"hide\",\"yTitle\":\"5m eps\"},\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filters\":[],\"datasourceStates\":{\"formBased\":{\"layers\":{\"999c9564-cba1-4f3b-af99-ccbacb8e034f\":{\"columnOrder\":[\"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e\",\"9ddc0f02-5530-4930-99bd-2a914ada1b8f\",\"be033d18-2c04-44f2-b403-0b88d888143d\"],\"columns\":{\"9ddc0f02-5530-4930-99bd-2a914ada1b8f\":{\"customLabel\":true,\"dataType\":\"string\",\"isBucketed\":true,\"label\":\"version\",\"operationType\":\"terms\",\"params\":{\"exclude\":[],\"excludeIsRegex\":false,\"include\":[],\"includeIsRegex\":false,\"missingBucket\":false,\"orderAgg\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Maximum of version_num\",\"operationType\":\"max\",\"params\":{\"emptyAsNull\":true},\"scale\":\"ratio\",\"sourceField\":\"version_num\"},\"orderBy\":{\"type\":\"custom\"},\"orderDirection\":\"asc\",\"otherBucket\":true,\"parentFormat\":{\"id\":\"terms\"},\"size\":100},\"scale\":\"ordinal\",\"sourceField\":\"version.keyword\"},\"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e\":{\"dataType\":\"string\",\"isBucketed\":true,\"label\":\"Top values of workers.keyword + 1 other\",\"operationType\":\"terms\",\"params\":{\"exclude\":[],\"excludeIsRegex\":false,\"include\":[],\"includeIsRegex\":false,\"missingBucket\":false,\"orderBy\":{\"columnId\":\"be033d18-2c04-44f2-b403-0b88d888143d\",\"type\":\"column\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"parentFormat\":{\"id\":\"multi_terms\"},\"secondaryFields\":[\"queue_type.keyword\"],\"size\":100},\"scale\":\"ordinal\",\"sourceField\":\"workers.keyword\"},\"be033d18-2c04-44f2-b403-0b88d888143d\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Median of max_eps_5m\",\"operationType\":\"median\",\"params\":{\"emptyAsNull\":true},\"scale\":\"ratio\",\"sourceField\":\"max_eps_5m\"}},\"incompleteColumns\":{},\"sampling\":1,\"indexPatternId\":\"c5493557-3fd6-4929-8dc2-40d248303942\"}},\"currentIndexPatternId\":\"c5493557-3fd6-4929-8dc2-40d248303942\"},\"indexpattern\":{\"layers\":{}},\"textBased\":{\"layers\":{}}},\"internalReferences\":[],\"adHocDataViews\":{}},\"references\":[{\"type\":\"index-pattern\",\"id\":\"c5493557-3fd6-4929-8dc2-40d248303942\",\"name\":\"indexpattern-datasource-layer-999c9564-cba1-4f3b-af99-ccbacb8e034f\"}],\"type\":\"lens\"}},\"panelRefName\":\"panel_329684df-6ec4-4973-8c96-bc91eaa23fe9\"},{\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":19,\"w\":16,\"h\":17,\"i\":\"68db206a-6de8-40a8-bd6c-b82d78a41ac7\"},\"panelIndex\":\"68db206a-6de8-40a8-bd6c-b82d78a41ac7\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_68db206a-6de8-40a8-bd6c-b82d78a41ac7\"},{\"type\":\"lens\",\"gridData\":{\"x\":16,\"y\":19,\"w\":16,\"h\":17,\"i\":\"485385cb-cd2b-408b-a119-5e7b15c15eeb\"},\"panelIndex\":\"485385cb-cd2b-408b-a119-5e7b15c15eeb\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_485385cb-cd2b-408b-a119-5e7b15c15eeb\"},{\"type\":\"lens\",\"gridData\":{\"x\":32,\"y\":19,\"w\":16,\"h\":17,\"i\":\"f29c5ed5-423f-44bc-8ded-2bdf8844f1ce\"},\"panelIndex\":\"f29c5ed5-423f-44bc-8ded-2bdf8844f1ce\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_f29c5ed5-423f-44bc-8ded-2bdf8844f1ce\"},{\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":36,\"w\":16,\"h\":16,\"i\":\"2934659f-462a-41b1-bdc0-344a7a4a2267\"},\"panelIndex\":\"2934659f-462a-41b1-bdc0-344a7a4a2267\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_2934659f-462a-41b1-bdc0-344a7a4a2267\"},{\"type\":\"lens\",\"gridData\":{\"x\":16,\"y\":36,\"w\":16,\"h\":16,\"i\":\"76f881d0-d2d3-4eaa-b71e-8cf8b7c1c5c2\"},\"panelIndex\":\"76f881d0-d2d3-4eaa-b71e-8cf8b7c1c5c2\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_76f881d0-d2d3-4eaa-b71e-8cf8b7c1c5c2\"},{\"type\":\"lens\",\"gridData\":{\"x\":32,\"y\":36,\"w\":16,\"h\":8,\"i\":\"99c4094f-8906-4ded-b56f-8e20107a8f3b\"},\"panelIndex\":\"99c4094f-8906-4ded-b56f-8e20107a8f3b\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_99c4094f-8906-4ded-b56f-8e20107a8f3b\"},{\"type\":\"lens\",\"gridData\":{\"x\":32,\"y\":44,\"w\":16,\"h\":8,\"i\":\"a8dd132b-9212-4c33-83ef-19ec5152448e\"},\"panelIndex\":\"a8dd132b-9212-4c33-83ef-19ec5152448e\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_a8dd132b-9212-4c33-83ef-19ec5152448e\"}]","refreshInterval":{"pause":true,"value":60000},"timeFrom":"now-1y","timeRestore":true,"timeTo":"now","title":"Logstash release benchmark","version":2},"coreMigrationVersion":"8.8.0","created_at":"2024-09-09T13:43:43.023Z","id":"901317cf-f97a-4d20-8420-53f0bf67c606","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index","type":"index-pattern"},{"id":"2c017667-7403-402c-b027-3cc790945a27","name":"329684df-6ec4-4973-8c96-bc91eaa23fe9:panel_329684df-6ec4-4973-8c96-bc91eaa23fe9","type":"lens"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"329684df-6ec4-4973-8c96-bc91eaa23fe9:indexpattern-datasource-layer-999c9564-cba1-4f3b-af99-ccbacb8e034f","type":"index-pattern"},{"id":"a577558f-f9a6-4c86-b562-7618b2c71db0","name":"68db206a-6de8-40a8-bd6c-b82d78a41ac7:panel_68db206a-6de8-40a8-bd6c-b82d78a41ac7","type":"lens"},{"id":"9546a73b-5937-4d3d-850f-30625d6e1405","name":"485385cb-cd2b-408b-a119-5e7b15c15eeb:panel_485385cb-cd2b-408b-a119-5e7b15c15eeb","type":"lens"},{"id":"6fba7dff-2564-450b-b885-8c6cf97fa727","name":"f29c5ed5-423f-44bc-8ded-2bdf8844f1ce:panel_f29c5ed5-423f-44bc-8ded-2bdf8844f1ce","type":"lens"},{"id":"72ae6cc9-47cd-4b51-b441-86905c2b92bd","name":"2934659f-462a-41b1-bdc0-344a7a4a2267:panel_2934659f-462a-41b1-bdc0-344a7a4a2267","type":"lens"},{"id":"661cb795-bb69-4599-8c4b-a4798ef69dc6","name":"76f881d0-d2d3-4eaa-b71e-8cf8b7c1c5c2:panel_76f881d0-d2d3-4eaa-b71e-8cf8b7c1c5c2","type":"lens"},{"id":"d79b8742-6284-4842-ac44-65640d090179","name":"99c4094f-8906-4ded-b56f-8e20107a8f3b:panel_99c4094f-8906-4ded-b56f-8e20107a8f3b","type":"lens"},{"id":"1872e84f-56f2-4a17-9426-3d25d6e03931","name":"a8dd132b-9212-4c33-83ef-19ec5152448e:panel_a8dd132b-9212-4c33-83ef-19ec5152448e","type":"lens"}],"type":"dashboard","typeMigrationVersion":"10.2.0","updated_at":"2024-10-24T11:45:42.246Z","updated_by":"u_4132377203_cloud","version":"WzE3NjMsOV0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_utilization","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_utilization"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"368034aa-1121-464d-8aed-8a4312274fa8","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"endValue":"None","fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"position":"top","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_utilization (%)"}},"title":"[MQ][R] Worker Utilization (%) by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-11T09:52:50.960Z","id":"6295535b-736d-4704-99d3-1cc0c4bb4cb4","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"368034aa-1121-464d-8aed-8a4312274fa8","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-11T09:52:50.960Z","version":"WzEzODcsN10="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"version","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_utilization","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_utilization"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"b16664e5-7dda-45f4-853a-0ae2a0e0a692","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"endValue":"None","fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"position":"top","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_utilization (%)"}},"title":"[PQ][R] Worker Utilization (%) by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-11T09:51:33.831Z","id":"64d0f8a7-afe3-4443-88e1-7551d666fee8","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"b16664e5-7dda-45f4-853a-0ae2a0e0a692","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-11T09:51:33.831Z","version":"WzEzNzcsN10="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_concurrency","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_concurrency"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"8e8a8743-f0a4-47ed-a4f0-21e21971e264","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_concurrency"}},"title":"[MQ] Worker Concurrency by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"8cbdba7b-e921-42b9-b55b-da567717e259","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"8e8a8743-f0a4-47ed-a4f0-21e21971e264","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0Nyw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_queue_events","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_queue_events"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"738fa511-8000-4f6a-b892-4a767bd733ab","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"events in queue"}},"title":"[PQ] events in queue by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"7a2c9e96-8e48-4546-b736-065757a52c47","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"738fa511-8000-4f6a-b892-4a767bd733ab","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0Myw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of total_events_out","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"total_events_out"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"6dab2bf1-e8cd-4d30-99d6-4e8038c8d19b","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"total events out"}},"title":"[PQ] total events out by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"daa3722a-cab7-49ba-b5bb-033e81133096","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"6dab2bf1-e8cd-4d30-99d6-4e8038c8d19b","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0MSw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_concurrency","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_concurrency"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"80e5b5e1-481a-478e-b5cd-3ad74106ff85","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_concurrency"}},"title":"[PQ] Worker Concurrency by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"f233b0e6-8ca5-4c29-a6b3-1f1bc83509fd","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"80e5b5e1-481a-478e-b5cd-3ad74106ff85","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0Miw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of total_events_out","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"total_events_out"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"dd6c6d40-b512-4c67-94f0-02cb3e9e65bd","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"total events out"}},"title":"[MQ] total events out by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"b0a3d8ea-030a-46e5-95b4-9f73b625f6ee","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"dd6c6d40-b512-4c67-94f0-02cb3e9e65bd","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0Niw3XQ=="} +{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[{\"meta\":{\"disabled\":false,\"negate\":false,\"alias\":null,\"key\":\"release\",\"field\":\"release\",\"params\":{\"query\":false},\"type\":\"phrase\",\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"query\":{\"match_phrase\":{\"release\":false}},\"$state\":{\"store\":\"appState\"}}]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"syncCursor\":true,\"syncTooltips\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":14,\"i\":\"c0ef3cf2-9dbe-4a88-a176-c50422d9041f\"},\"panelIndex\":\"c0ef3cf2-9dbe-4a88-a176-c50422d9041f\",\"embeddableConfig\":{\"enhancements\":{},\"attributes\":{\"title\":\"Daily EPS by queue & worker\",\"description\":\"\",\"visualizationType\":\"lnsXY\",\"state\":{\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"Linear\",\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"line\",\"layers\":[{\"layerId\":\"999c9564-cba1-4f3b-af99-ccbacb8e034f\",\"seriesType\":\"line\",\"xAccessor\":\"9ddc0f02-5530-4930-99bd-2a914ada1b8f\",\"splitAccessor\":\"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e\",\"accessors\":[\"be033d18-2c04-44f2-b403-0b88d888143d\"],\"layerType\":\"data\",\"colorMapping\":{\"assignments\":[{\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"8\",\"memory\"]]},\"color\":{\"type\":\"colorCode\",\"colorCode\":\"#207f8c\"},\"touched\":true},{\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"16\",\"memory\"]]},\"color\":{\"type\":\"colorCode\",\"colorCode\":\"#0055fc\"},\"touched\":true},{\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"4\",\"memory\"]]},\"color\":{\"type\":\"colorCode\",\"colorCode\":\"#99e6e8\"},\"touched\":true},{\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"8\",\"persisted\"]]},\"color\":{\"type\":\"colorCode\",\"colorCode\":\"#c3513a\"},\"touched\":true},{\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"16\",\"persisted\"]]},\"color\":{\"type\":\"colorCode\",\"colorCode\":\"#fd1900\"},\"touched\":true},{\"rule\":{\"type\":\"matchExactly\",\"values\":[[\"4\",\"persisted\"]]},\"color\":{\"type\":\"colorCode\",\"colorCode\":\"#e88888\"},\"touched\":true}],\"specialAssignments\":[{\"rule\":{\"type\":\"other\"},\"color\":{\"type\":\"loop\"},\"touched\":false}],\"paletteId\":\"eui_amsterdam_color_blind\",\"colorMode\":{\"type\":\"categorical\"}}}],\"yTitle\":\"5m eps\"},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"datasourceStates\":{\"formBased\":{\"layers\":{\"999c9564-cba1-4f3b-af99-ccbacb8e034f\":{\"columns\":{\"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e\":{\"label\":\"Top values of workers.keyword + 1 other\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"workers.keyword\",\"isBucketed\":true,\"params\":{\"size\":6,\"orderBy\":{\"type\":\"column\",\"columnId\":\"be033d18-2c04-44f2-b403-0b88d888143d\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false,\"parentFormat\":{\"id\":\"multi_terms\"},\"include\":[],\"exclude\":[],\"includeIsRegex\":false,\"excludeIsRegex\":false,\"secondaryFields\":[\"queue_type.keyword\"]}},\"9ddc0f02-5530-4930-99bd-2a914ada1b8f\":{\"label\":\"timestamp\",\"dataType\":\"date\",\"operationType\":\"date_histogram\",\"sourceField\":\"timestamp\",\"isBucketed\":true,\"scale\":\"interval\",\"params\":{\"interval\":\"auto\",\"includeEmptyRows\":true,\"dropPartials\":false}},\"be033d18-2c04-44f2-b403-0b88d888143d\":{\"label\":\"Median of 5m_num\",\"dataType\":\"number\",\"operationType\":\"median\",\"sourceField\":\"5m_num\",\"isBucketed\":false,\"scale\":\"ratio\",\"params\":{\"emptyAsNull\":true}}},\"columnOrder\":[\"a58f8c48-c2a7-4fc6-b54e-716bf4ca001e\",\"9ddc0f02-5530-4930-99bd-2a914ada1b8f\",\"be033d18-2c04-44f2-b403-0b88d888143d\"],\"incompleteColumns\":{},\"sampling\":1,\"indexPatternId\":\"c5493557-3fd6-4929-8dc2-40d248303942\"}},\"currentIndexPatternId\":\"c5493557-3fd6-4929-8dc2-40d248303942\"},\"indexpattern\":{\"layers\":{}},\"textBased\":{\"layers\":{}}},\"internalReferences\":[],\"adHocDataViews\":{}},\"references\":[{\"id\":\"c5493557-3fd6-4929-8dc2-40d248303942\",\"name\":\"indexpattern-datasource-layer-999c9564-cba1-4f3b-af99-ccbacb8e034f\",\"type\":\"index-pattern\"}],\"type\":\"lens\"}},\"panelRefName\":\"panel_c0ef3cf2-9dbe-4a88-a176-c50422d9041f\"},{\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":14,\"w\":16,\"h\":14,\"i\":\"3fc59b3e-512e-4a47-baa4-e89e4978b685\"},\"panelIndex\":\"3fc59b3e-512e-4a47-baa4-e89e4978b685\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_3fc59b3e-512e-4a47-baa4-e89e4978b685\"},{\"type\":\"lens\",\"gridData\":{\"x\":16,\"y\":14,\"w\":16,\"h\":14,\"i\":\"6294036c-7c92-4e51-990d-ace6af0de939\"},\"panelIndex\":\"6294036c-7c92-4e51-990d-ace6af0de939\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_6294036c-7c92-4e51-990d-ace6af0de939\"},{\"type\":\"lens\",\"gridData\":{\"x\":32,\"y\":28,\"w\":16,\"h\":8,\"i\":\"77d40890-d175-436f-aac3-7bcc9f7beacc\"},\"panelIndex\":\"77d40890-d175-436f-aac3-7bcc9f7beacc\",\"embeddableConfig\":{\"attributes\":{\"title\":\"PQ max q events by worker\",\"description\":\"\",\"visualizationType\":\"lnsXY\",\"state\":{\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\",\"isInside\":true,\"showSingleSeries\":true,\"legendSize\":\"small\",\"shouldTruncate\":true,\"verticalAlignment\":\"bottom\",\"horizontalAlignment\":\"left\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"Linear\",\"yTitle\":\"events in queue\",\"hideEndzones\":false,\"showCurrentTimeMarker\":false,\"valuesInLegend\":false,\"axisTitlesVisibilitySettings\":{\"x\":false,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"line\",\"layers\":[{\"layerId\":\"eb818eba-fa75-45d1-a9ee-6619eecc9280\",\"seriesType\":\"line\",\"splitAccessor\":\"0da92b64-fe48-439e-9b3a-47775ce1a149\",\"accessors\":[\"cc8c1413-0ccc-4109-a6c3-0c910eff776e\"],\"layerType\":\"data\",\"colorMapping\":{\"assignments\":[{\"rule\":{\"type\":\"matchExactly\",\"values\":[\"4\"]},\"color\":{\"type\":\"categorical\",\"paletteId\":\"eui_amsterdam_color_blind\",\"colorIndex\":0},\"touched\":false},{\"rule\":{\"type\":\"matchExactly\",\"values\":[\"8\"]},\"color\":{\"type\":\"categorical\",\"paletteId\":\"eui_amsterdam_color_blind\",\"colorIndex\":1},\"touched\":false},{\"rule\":{\"type\":\"matchExactly\",\"values\":[\"16\"]},\"color\":{\"type\":\"categorical\",\"paletteId\":\"eui_amsterdam_color_blind\",\"colorIndex\":2},\"touched\":false}],\"specialAssignments\":[{\"rule\":{\"type\":\"other\"},\"color\":{\"type\":\"loop\"},\"touched\":false}],\"paletteId\":\"eui_amsterdam_color_blind\",\"colorMode\":{\"type\":\"categorical\"}},\"xAccessor\":\"9542ed03-9691-42a3-b5c2-407bcaab221c\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[{\"meta\":{\"disabled\":false,\"negate\":false,\"alias\":null,\"index\":\"599131c3-0cd9-4a1f-b9da-9894538d58cc\",\"key\":\"queue_type.keyword\",\"field\":\"queue_type.keyword\",\"params\":{\"query\":\"persisted\"},\"type\":\"phrase\"},\"query\":{\"match_phrase\":{\"queue_type.keyword\":\"persisted\"}},\"$state\":{\"store\":\"appState\"}}],\"datasourceStates\":{\"formBased\":{\"layers\":{\"eb818eba-fa75-45d1-a9ee-6619eecc9280\":{\"columns\":{\"0da92b64-fe48-439e-9b3a-47775ce1a149\":{\"label\":\"workers\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"workers.keyword\",\"isBucketed\":true,\"params\":{\"size\":3,\"orderBy\":{\"type\":\"column\",\"columnId\":\"cc8c1413-0ccc-4109-a6c3-0c910eff776e\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false,\"parentFormat\":{\"id\":\"terms\"},\"include\":[],\"exclude\":[],\"includeIsRegex\":false,\"excludeIsRegex\":false,\"accuracyMode\":false},\"customLabel\":true},\"9542ed03-9691-42a3-b5c2-407bcaab221c\":{\"label\":\"timestamp\",\"dataType\":\"date\",\"operationType\":\"date_histogram\",\"sourceField\":\"timestamp\",\"isBucketed\":true,\"scale\":\"interval\",\"params\":{\"interval\":\"auto\",\"includeEmptyRows\":true,\"dropPartials\":false}},\"cc8c1413-0ccc-4109-a6c3-0c910eff776e\":{\"label\":\"Median of max_queue_events_num\",\"dataType\":\"number\",\"operationType\":\"median\",\"sourceField\":\"max_queue_events_num\",\"isBucketed\":false,\"scale\":\"ratio\",\"params\":{\"emptyAsNull\":true}}},\"columnOrder\":[\"0da92b64-fe48-439e-9b3a-47775ce1a149\",\"9542ed03-9691-42a3-b5c2-407bcaab221c\",\"cc8c1413-0ccc-4109-a6c3-0c910eff776e\"],\"incompleteColumns\":{},\"sampling\":1,\"indexPatternId\":\"c5493557-3fd6-4929-8dc2-40d248303942\"}},\"currentIndexPatternId\":\"c5493557-3fd6-4929-8dc2-40d248303942\"},\"indexpattern\":{\"layers\":{}},\"textBased\":{\"layers\":{}}},\"internalReferences\":[],\"adHocDataViews\":{}},\"references\":[{\"id\":\"c5493557-3fd6-4929-8dc2-40d248303942\",\"name\":\"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280\",\"type\":\"index-pattern\"}],\"type\":\"lens\"},\"enhancements\":{}},\"panelRefName\":\"panel_77d40890-d175-436f-aac3-7bcc9f7beacc\"},{\"type\":\"lens\",\"gridData\":{\"x\":32,\"y\":36,\"w\":16,\"h\":8,\"i\":\"8bd920f9-5be7-4481-b733-ba83bdd127d5\"},\"panelIndex\":\"8bd920f9-5be7-4481-b733-ba83bdd127d5\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_8bd920f9-5be7-4481-b733-ba83bdd127d5\"},{\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":28,\"w\":16,\"h\":16,\"i\":\"23581637-2ff1-4cae-a839-345620c3d180\"},\"panelIndex\":\"23581637-2ff1-4cae-a839-345620c3d180\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_23581637-2ff1-4cae-a839-345620c3d180\"},{\"type\":\"lens\",\"gridData\":{\"x\":16,\"y\":28,\"w\":16,\"h\":16,\"i\":\"c7ab44aa-4607-40b7-b268-d69136bfdcde\"},\"panelIndex\":\"c7ab44aa-4607-40b7-b268-d69136bfdcde\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_c7ab44aa-4607-40b7-b268-d69136bfdcde\"},{\"type\":\"lens\",\"gridData\":{\"x\":32,\"y\":14,\"w\":16,\"h\":14,\"i\":\"01628fc9-19c2-4c65-bc9f-3f284f77c309\"},\"panelIndex\":\"01628fc9-19c2-4c65-bc9f-3f284f77c309\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_01628fc9-19c2-4c65-bc9f-3f284f77c309\"}]","refreshInterval":{"pause":true,"value":60000},"timeFrom":"now-2M","timeRestore":true,"timeTo":"now","title":"Logstash daily benchmark","version":1},"coreMigrationVersion":"8.8.0","created_at":"2024-09-09T13:44:20.764Z","id":"9ef273e3-bee2-48bb-9976-7edc19454b93","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index","type":"index-pattern"},{"id":"94ae4c78-8004-4abb-80c9-271f37c94cdc","name":"c0ef3cf2-9dbe-4a88-a176-c50422d9041f:panel_c0ef3cf2-9dbe-4a88-a176-c50422d9041f","type":"lens"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"c0ef3cf2-9dbe-4a88-a176-c50422d9041f:indexpattern-datasource-layer-999c9564-cba1-4f3b-af99-ccbacb8e034f","type":"index-pattern"},{"id":"f5104988-461c-4f65-b31d-ed22d04cb6b8","name":"3fc59b3e-512e-4a47-baa4-e89e4978b685:panel_3fc59b3e-512e-4a47-baa4-e89e4978b685","type":"lens"},{"id":"8cbdba7b-e921-42b9-b55b-da567717e259","name":"6294036c-7c92-4e51-990d-ace6af0de939:panel_6294036c-7c92-4e51-990d-ace6af0de939","type":"lens"},{"id":"7a2c9e96-8e48-4546-b736-065757a52c47","name":"77d40890-d175-436f-aac3-7bcc9f7beacc:panel_77d40890-d175-436f-aac3-7bcc9f7beacc","type":"lens"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"77d40890-d175-436f-aac3-7bcc9f7beacc:indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"daa3722a-cab7-49ba-b5bb-033e81133096","name":"8bd920f9-5be7-4481-b733-ba83bdd127d5:panel_8bd920f9-5be7-4481-b733-ba83bdd127d5","type":"lens"},{"id":"4d1f7bef-c184-4457-b159-465128d2d70b","name":"23581637-2ff1-4cae-a839-345620c3d180:panel_23581637-2ff1-4cae-a839-345620c3d180","type":"lens"},{"id":"f233b0e6-8ca5-4c29-a6b3-1f1bc83509fd","name":"c7ab44aa-4607-40b7-b268-d69136bfdcde:panel_c7ab44aa-4607-40b7-b268-d69136bfdcde","type":"lens"},{"id":"b0a3d8ea-030a-46e5-95b4-9f73b625f6ee","name":"01628fc9-19c2-4c65-bc9f-3f284f77c309:panel_01628fc9-19c2-4c65-bc9f-3f284f77c309","type":"lens"}],"type":"dashboard","typeMigrationVersion":"10.2.0","updated_at":"2024-09-09T13:44:20.764Z","version":"WzE0ODksOF0="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_utilization","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_utilization"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"9aee27f1-97bc-46c4-b369-81b7cd5fe38c","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"endValue":"None","fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"position":"top","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_utilization (%)"}},"title":"[PQ] Worker Utilization (%) by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"07700ebe-b8c9-498f-9a91-30efb0c48784","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"9aee27f1-97bc-46c4-b369-81b7cd5fe38c","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0MCw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of max_worker_utilization","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"max_worker_utilization"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"4e0f2401-369e-4818-8a1f-52b64ff175df","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"worker_utilization (%)"}},"title":"[MQ] Worker Utilization (%) by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"29ebb6b1-bee6-4f15-b3dc-aac083d5d2f5","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"4e0f2401-369e-4818-8a1f-52b64ff175df","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0NSw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"string","isBucketed":true,"label":"Top 100 values of version.keyword","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of avg_cpu_percentage","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"avg_cpu_percentage"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"index":"f4c5b868-7b2c-4d12-b989-9a057dd128e4","negate":false,"params":[{"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"c5493557-3fd6-4929-8dc2-40d248303942","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}},{"meta":{"alias":null,"disabled":false,"field":"release","index":"c5493557-3fd6-4929-8dc2-40d248303942","key":"release","negate":false,"params":{"query":true},"type":"phrase"},"query":{"match_phrase":{"release":true}}}],"relation":"AND","type":"combined"},"query":{}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"avg cpu (%)"}},"title":"[MQ][R] cpu % by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"26ec195e-e4a9-4417-be97-6d1fbc6b63c0","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"f4c5b868-7b2c-4d12-b989-9a057dd128e4","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc0OSw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"string","isBucketed":true,"label":"Top 100 values of version.keyword","operationType":"terms","params":{"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderAgg":{"dataType":"number","isBucketed":false,"label":"Maximum of version_num","operationType":"max","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"version_num"},"orderBy":{"type":"custom"},"orderDirection":"asc","otherBucket":true,"parentFormat":{"id":"terms"},"size":100},"scale":"ordinal","sourceField":"version.keyword"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of avg_cpu_percentage","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"avg_cpu_percentage"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"index":"da1edddb-a868-406c-b3a3-e02cf1069e50","negate":false,"params":[{"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"c5493557-3fd6-4929-8dc2-40d248303942","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}},{"meta":{"alias":null,"disabled":false,"field":"release","index":"c5493557-3fd6-4929-8dc2-40d248303942","key":"release","negate":false,"params":{"query":true},"type":"phrase"},"query":{"match_phrase":{"release":true}}}],"relation":"AND","type":"combined"},"query":{}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"avg cpu (%)"}},"title":"[PQ][R] cpu % by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"bb65f9af-1246-4e75-8b61-dea93d920da8","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"da1edddb-a868-406c-b3a3-e02cf1069e50","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc1MCw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of avg_cpu_percentage","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"avg_cpu_percentage"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"637adce1-2cf3-4869-a35d-ead85c340ab9","key":"queue_type.keyword","negate":false,"params":{"query":"persisted"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"persisted"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"avg cpu (%)"}},"title":"[PQ] cpu % by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"fc548f47-c5ab-491f-a234-4f24ce439d55","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"637adce1-2cf3-4869-a35d-ead85c340ab9","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc1Myw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"eb818eba-fa75-45d1-a9ee-6619eecc9280":{"columnOrder":["0da92b64-fe48-439e-9b3a-47775ce1a149","9542ed03-9691-42a3-b5c2-407bcaab221c","cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"columns":{"0da92b64-fe48-439e-9b3a-47775ce1a149":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"workers","operationType":"terms","params":{"accuracyMode":false,"exclude":[],"excludeIsRegex":false,"include":[],"includeIsRegex":false,"missingBucket":false,"orderBy":{"columnId":"cc8c1413-0ccc-4109-a6c3-0c910eff776e","type":"column"},"orderDirection":"desc","otherBucket":true,"parentFormat":{"id":"terms"},"size":10},"scale":"ordinal","sourceField":"workers.keyword"},"9542ed03-9691-42a3-b5c2-407bcaab221c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"cc8c1413-0ccc-4109-a6c3-0c910eff776e":{"dataType":"number","isBucketed":false,"label":"Median of avg_cpu_percentage","operationType":"median","params":{"emptyAsNull":true},"scale":"ratio","sourceField":"avg_cpu_percentage"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[{"$state":{"store":"appState"},"meta":{"alias":null,"disabled":false,"field":"queue_type.keyword","index":"26183784-8280-42c4-ae7c-71c4e9a5908c","key":"queue_type.keyword","negate":false,"params":{"query":"memory"},"type":"phrase"},"query":{"match_phrase":{"queue_type.keyword":"memory"}}}],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"Linear","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"hideEndzones":false,"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["cc8c1413-0ccc-4109-a6c3-0c910eff776e"],"colorMapping":{"assignments":[{"color":{"colorIndex":0,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["4"]},"touched":false},{"color":{"colorIndex":1,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["8"]},"touched":false},{"color":{"colorIndex":2,"paletteId":"eui_amsterdam_color_blind","type":"categorical"},"rule":{"type":"matchExactly","values":["16"]},"touched":false}],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"eb818eba-fa75-45d1-a9ee-6619eecc9280","layerType":"data","seriesType":"line","splitAccessor":"0da92b64-fe48-439e-9b3a-47775ce1a149","xAccessor":"9542ed03-9691-42a3-b5c2-407bcaab221c"}],"legend":{"horizontalAlignment":"left","isInside":true,"isVisible":true,"legendSize":"small","position":"right","shouldTruncate":true,"showSingleSeries":true,"verticalAlignment":"bottom"},"preferredSeriesType":"line","showCurrentTimeMarker":false,"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","valuesInLegend":false,"yTitle":"avg cpu (%)"}},"title":"[MQ] cpu % by worker","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-09-05T11:52:42.820Z","id":"b3c44ade-7f2f-497a-bc9b-f4b53695d975","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-eb818eba-fa75-45d1-a9ee-6619eecc9280","type":"index-pattern"},{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"26183784-8280-42c4-ae7c-71c4e9a5908c","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-09-05T11:52:42.820Z","version":"Wzc1NCw3XQ=="} +{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"904fa8c5-7ce1-45ec-bc0d-a52929cabaa6":{"columnOrder":["3dfc74bb-0629-4809-8416-282f6924ecf6","2e3311e8-099f-48bc-81e8-f8dd643cee72","c62ffb65-c24f-49fe-b8ed-683257e60808"],"columns":{"2e3311e8-099f-48bc-81e8-f8dd643cee72":{"dataType":"number","isBucketed":false,"label":"Moving average of Last value of 5m_num","operationType":"moving_average","params":{"window":5},"references":["c62ffb65-c24f-49fe-b8ed-683257e60808"],"scale":"ratio"},"3dfc74bb-0629-4809-8416-282f6924ecf6":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"c62ffb65-c24f-49fe-b8ed-683257e60808":{"dataType":"number","filter":{"language":"kuery","query":"\"5m_num\": *"},"isBucketed":false,"label":"Last value of 5m_num","operationType":"last_value","params":{"showArrayValues":true,"sortField":"timestamp"},"scale":"ratio","sourceField":"5m_num"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["2e3311e8-099f-48bc-81e8-f8dd643cee72"],"colorMapping":{"assignments":[],"colorMode":{"type":"categorical"},"paletteId":"eui_amsterdam_color_blind","specialAssignments":[{"color":{"type":"loop"},"rule":{"type":"other"},"touched":false}]},"layerId":"904fa8c5-7ce1-45ec-bc0d-a52929cabaa6","layerType":"data","position":"top","seriesType":"bar","showGridlines":false,"xAccessor":"3dfc74bb-0629-4809-8416-282f6924ecf6"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide"}},"title":"logstash_5m_eps","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-07-08T16:56:26.170Z","id":"af3a2cb0-138f-4b4a-aaf8-49ff4325386d","managed":false,"references":[{"id":"c5493557-3fd6-4929-8dc2-40d248303942","name":"indexpattern-datasource-layer-904fa8c5-7ce1-45ec-bc0d-a52929cabaa6","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-07-08T16:56:26.170Z","version":"WzQzLDRd"} +{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":30,"missingRefCount":0,"missingReferences":[]} \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/setup/alias b/.buildkite/scripts/benchmark/setup/alias new file mode 100644 index 000000000..efa658a4d --- /dev/null +++ b/.buildkite/scripts/benchmark/setup/alias @@ -0,0 +1,6 @@ +POST /_aliases +{ + "actions": [ + { "add": { "index": "benchmark_summary_v2", "alias": "benchmark_summary" } } + ] +} \ No newline at end of file diff --git a/.buildkite/scripts/benchmark/setup/benchmark_summary_v2 b/.buildkite/scripts/benchmark/setup/benchmark_summary_v2 new file mode 100644 index 000000000..57c80f8c7 --- /dev/null +++ b/.buildkite/scripts/benchmark/setup/benchmark_summary_v2 @@ -0,0 +1,179 @@ +PUT /benchmark_summary_v2/_mapping +{ + "properties": { + "avg_cpu_percentage": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "avg_heap": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "avg_non_heap": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "avg_virtual_memory": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "batch_size": { + "type": "integer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "cpu": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "max_eps_1m": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "max_eps_5m": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "max_queue_bytes_size": { + "type": "integer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "max_queue_events": { + "type": "integer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "max_worker_concurrency": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "max_worker_utilization": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "mem": { + "type": "float", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "queue_type": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "tag": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "timestamp": { + "type": "date" + }, + "total_events_out": { + "type": "integer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "version": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "workers": { + "type": "integer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "tags" : { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + } +} diff --git a/.buildkite/scripts/benchmark/util.sh b/.buildkite/scripts/benchmark/util.sh new file mode 100755 index 000000000..ac036d59e --- /dev/null +++ b/.buildkite/scripts/benchmark/util.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +arch() { uname -m | sed -e "s|amd|x86_|" -e "s|arm|aarch|"; } + +# return the min value +# usage: +# g: float; h: human; d: dictionary; M: month +# min -g 3 2 5 1 +# max -g 1.5 5.2 2.5 1.2 5.7 +# max -g "null" "0" +# min -h 25M 13G 99K 1098M +min() { printf "%s\n" "${@:2}" | sort "$1" | head -n1 ; } + +max() { min ${1}r ${@:2} ; } + +# return the average of values +# usage: +# jqavg '.process.cpu.percent' m_w8b1000_*.json +# $1: jq field +# $2: file path in glob pattern +jqavg() { + jq -r "$1 | select(. != null)" $2 | jq -s . | jq 'add / length' +} + +# return the maximum of values +# usage: +# jqmax '.process.cpu.percent' m_w8b1000_*.json +# $1: jq field +# $2: file path in glob pattern +jqmax() { + jq -r "$1 | select(. != null)" $2 | jq -s . | jq 'max' +} + +# return true if $1 is non empty and not "null" +not_empty() { + if [[ -n "$1" && "$1" != "null" ]]; then + return 0 + else + return 1 + fi +} \ No newline at end of file diff --git a/.buildkite/scripts/common/check-files-changed.sh b/.buildkite/scripts/common/check-files-changed.sh index c04db83b2..b02dc356b 100755 --- a/.buildkite/scripts/common/check-files-changed.sh +++ b/.buildkite/scripts/common/check-files-changed.sh @@ -19,7 +19,7 @@ changed_files=$(git diff --name-only $previous_commit) if [[ -n "$changed_files" ]] && [[ -z "$(echo "$changed_files" | grep -vE "$1")" ]]; then echo "All files compared to the previous commit [$previous_commit] match the specified regex: [$1]" echo "Files changed:" - git diff --name-only HEAD^ + git --no-pager diff --name-only HEAD^ exit 0 else exit 1 diff --git a/.buildkite/scripts/common/qualified-version.sh b/.buildkite/scripts/common/qualified-version.sh new file mode 100755 index 000000000..4d8e32adb --- /dev/null +++ b/.buildkite/scripts/common/qualified-version.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# ******************************************************** +# Source this script to get the QUALIFIED_VERSION env var +# or execute it to receive the qualified version on stdout +# ******************************************************** + +set -euo pipefail + +export QUALIFIED_VERSION="$( + # Extract the version number from the version.yml file + # e.g.: 8.6.0 + printf '%s' "$(awk -F':' '{ if ("logstash" == $1) { gsub(/^ | $/,"",$2); printf $2; exit } }' versions.yml)" + + # Qualifier is passed from CI as optional field and specify the version postfix + # in case of alpha or beta releases for staging builds only: + # e.g: 8.0.0-alpha1 + printf '%s' "${VERSION_QUALIFIER:+-${VERSION_QUALIFIER}}" + + # add the SNAPSHOT tag unless WORKFLOW_TYPE=="staging" or RELEASE=="1" + if [[ ! ( "${WORKFLOW_TYPE:-}" == "staging" || "${RELEASE:+$RELEASE}" == "1" ) ]]; then + printf '%s' "-SNAPSHOT" + fi +)" + +# if invoked directly, output the QUALIFIED_VERSION to stdout +if [[ "$0" == "${BASH_SOURCE:-${ZSH_SCRIPT:-}}" ]]; then + printf '%s' "${QUALIFIED_VERSION}" +fi diff --git a/.buildkite/scripts/common/trigger-pipeline-generate-steps.sh b/.buildkite/scripts/common/trigger-pipeline-generate-steps.sh index e6c7ef240..f0dc4263a 100755 --- a/.buildkite/scripts/common/trigger-pipeline-generate-steps.sh +++ b/.buildkite/scripts/common/trigger-pipeline-generate-steps.sh @@ -12,7 +12,7 @@ set -eo pipefail # https://github.com/elastic/ingest-dev/issues/2664 # ******************************************************* -ACTIVE_BRANCHES_URL="https://raw.githubusercontent.com/elastic/logstash/main/ci/branches.json" +ACTIVE_BRANCHES_URL="https://storage.googleapis.com/artifacts-api/snapshots/branches.json" EXCLUDE_BRANCHES_ARRAY=() BRANCHES=() @@ -63,7 +63,7 @@ exclude_branches_to_array set -u set +e # pull releaseable branches from $ACTIVE_BRANCHES_URL -readarray -t ELIGIBLE_BRANCHES < <(curl --retry-all-errors --retry 5 --retry-delay 5 -fsSL $ACTIVE_BRANCHES_URL | jq -r '.branches[].branch') +readarray -t ELIGIBLE_BRANCHES < <(curl --retry-all-errors --retry 5 --retry-delay 5 -fsSL $ACTIVE_BRANCHES_URL | jq -r '.branches[]') if [[ $? -ne 0 ]]; then echo "There was an error downloading or parsing the json output from [$ACTIVE_BRANCHES_URL]. Exiting." exit 1 diff --git a/.buildkite/scripts/common/vm-images.json b/.buildkite/scripts/common/vm-images.json index 6d34fb2a1..bd1f0d3ed 100644 --- a/.buildkite/scripts/common/vm-images.json +++ b/.buildkite/scripts/common/vm-images.json @@ -1,13 +1,13 @@ { "#comment": "This file lists all custom vm images. We use it to make decisions about randomized CI jobs.", "linux": { - "ubuntu": ["ubuntu-2204", "ubuntu-2004"], - "debian": ["debian-12", "debian-11", "debian-10"], + "ubuntu": ["ubuntu-2404", "ubuntu-2204", "ubuntu-2004"], + "debian": ["debian-12", "debian-11"], "rhel": ["rhel-9", "rhel-8"], "oraclelinux": ["oraclelinux-8", "oraclelinux-7"], "rocky": ["rocky-linux-8"], "amazonlinux": ["amazonlinux-2023"], "opensuse": ["opensuse-leap-15"] }, - "windows": ["windows-2022", "windows-2019", "windows-2016"] + "windows": ["windows-2025", "windows-2022", "windows-2019", "windows-2016"] } diff --git a/.buildkite/scripts/dra/build_docker.sh b/.buildkite/scripts/dra/build_docker.sh index fee8cce0e..0c89b56e5 100755 --- a/.buildkite/scripts/dra/build_docker.sh +++ b/.buildkite/scripts/dra/build_docker.sh @@ -7,59 +7,28 @@ echo "####################################################################" source ./$(dirname "$0")/common.sh # WORKFLOW_TYPE is a CI externally configured environment variable that could assume "snapshot" or "staging" values +info "Building artifacts for the $WORKFLOW_TYPE workflow ..." + case "$WORKFLOW_TYPE" in snapshot) - info "Building artifacts for the $WORKFLOW_TYPE workflow..." - if [ -z "$VERSION_QUALIFIER_OPT" ]; then - rake artifact:docker || error "artifact:docker build failed." - rake artifact:docker_oss || error "artifact:docker_oss build failed." - rake artifact:dockerfiles || error "artifact:dockerfiles build failed." - if [ "$ARCH" != "aarch64" ]; then - rake artifact:docker_ubi8 || error "artifact:docker_ubi8 build failed." - fi - else - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" rake artifact:docker || error "artifact:docker build failed." - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" rake artifact:docker_oss || error "artifact:docker_oss build failed." - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" rake artifact:dockerfiles || error "artifact:dockerfiles build failed." - if [ "$ARCH" != "aarch64" ]; then - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" rake artifact:docker_ubi8 || error "artifact:docker_ubi8 build failed." - fi - # Qualifier is passed from CI as optional field and specify the version postfix - # in case of alpha or beta releases: - # e.g: 8.0.0-alpha1 - STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER_OPT}" - fi - STACK_VERSION=${STACK_VERSION}-SNAPSHOT - info "Build complete, setting STACK_VERSION to $STACK_VERSION." + : # no-op ;; staging) - info "Building artifacts for the $WORKFLOW_TYPE workflow..." - if [ -z "$VERSION_QUALIFIER_OPT" ]; then - RELEASE=1 rake artifact:docker || error "artifact:docker build failed." - RELEASE=1 rake artifact:docker_oss || error "artifact:docker_oss build failed." - RELEASE=1 rake artifact:dockerfiles || error "artifact:dockerfiles build failed." - if [ "$ARCH" != "aarch64" ]; then - RELEASE=1 rake artifact:docker_ubi8 || error "artifact:docker_ubi8 build failed." - fi - else - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" RELEASE=1 rake artifact:docker || error "artifact:docker build failed." - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" RELEASE=1 rake artifact:docker_oss || error "artifact:docker_oss build failed." - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" RELEASE=1 rake artifact:dockerfiles || error "artifact:dockerfiles build failed." - if [ "$ARCH" != "aarch64" ]; then - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" RELEASE=1 rake artifact:docker_ubi8 || error "artifact:docker_ubi8 build failed." - fi - # Qualifier is passed from CI as optional field and specify the version postfix - # in case of alpha or beta releases: - # e.g: 8.0.0-alpha1 - STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER_OPT}" - fi - info "Build complete, setting STACK_VERSION to $STACK_VERSION." + export RELEASE=1 ;; *) error "Workflow (WORKFLOW_TYPE variable) is not set, exiting..." ;; esac +rake artifact:docker || error "artifact:docker build failed." +rake artifact:docker_oss || error "artifact:docker_oss build failed." +rake artifact:docker_wolfi || error "artifact:docker_wolfi build failed." +rake artifact:dockerfiles || error "artifact:dockerfiles build failed." + +STACK_VERSION="$(./$(dirname "$0")/../common/qualified-version.sh)" +info "Build complete, setting STACK_VERSION to $STACK_VERSION." + info "Saving tar.gz for docker images" save_docker_tarballs "${ARCH}" "${STACK_VERSION}" @@ -68,11 +37,7 @@ for file in build/logstash-*; do shasum $file;done info "Uploading DRA artifacts in buildkite's artifact store ..." # Note the deb, rpm tar.gz AARCH64 files generated has already been loaded by the build_packages.sh -images="logstash logstash-oss" -if [ "$ARCH" != "aarch64" ]; then - # No logstash-ubi8 for AARCH64 - images="logstash logstash-oss logstash-ubi8" -fi +images="logstash logstash-oss logstash-wolfi" for image in ${images}; do buildkite-agent artifact upload "build/$image-${STACK_VERSION}-docker-image-${ARCH}.tar.gz" done @@ -80,7 +45,7 @@ done # Upload 'docker-build-context.tar.gz' files only when build x86_64, otherwise they will be # overwritten when building aarch64 (or viceversa). if [ "$ARCH" != "aarch64" ]; then - for image in logstash logstash-oss logstash-ubi8 logstash-ironbank; do + for image in logstash logstash-oss logstash-wolfi logstash-ironbank; do buildkite-agent artifact upload "build/${image}-${STACK_VERSION}-docker-build-context.tar.gz" done fi diff --git a/.buildkite/scripts/dra/build_packages.sh b/.buildkite/scripts/dra/build_packages.sh index 2bd4ed175..3d297bcdc 100755 --- a/.buildkite/scripts/dra/build_packages.sh +++ b/.buildkite/scripts/dra/build_packages.sh @@ -7,39 +7,25 @@ echo "####################################################################" source ./$(dirname "$0")/common.sh # WORKFLOW_TYPE is a CI externally configured environment variable that could assume "snapshot" or "staging" values +info "Building artifacts for the $WORKFLOW_TYPE workflow ..." + case "$WORKFLOW_TYPE" in snapshot) - info "Building artifacts for the $WORKFLOW_TYPE workflow..." - if [ -z "$VERSION_QUALIFIER_OPT" ]; then - SKIP_DOCKER=1 rake artifact:all || error "rake artifact:all build failed." - else - # Qualifier is passed from CI as optional field and specify the version postfix - # in case of alpha or beta releases: - # e.g: 8.0.0-alpha1 - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" SKIP_DOCKER=1 rake artifact:all || error "rake artifact:all build failed." - STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER_OPT}" - fi - STACK_VERSION=${STACK_VERSION}-SNAPSHOT - info "Build complete, setting STACK_VERSION to $STACK_VERSION." + : # no-op ;; staging) - info "Building artifacts for the $WORKFLOW_TYPE workflow..." - if [ -z "$VERSION_QUALIFIER_OPT" ]; then - RELEASE=1 SKIP_DOCKER=1 rake artifact:all || error "rake artifact:all build failed." - else - # Qualifier is passed from CI as optional field and specify the version postfix - # in case of alpha or beta releases: - # e.g: 8.0.0-alpha1 - VERSION_QUALIFIER="$VERSION_QUALIFIER_OPT" RELEASE=1 SKIP_DOCKER=1 rake artifact:all || error "rake artifact:all build failed." - STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER_OPT}" - fi - info "Build complete, setting STACK_VERSION to $STACK_VERSION." + export RELEASE=1 ;; *) error "Workflow (WORKFLOW_TYPE variable) is not set, exiting..." ;; esac +SKIP_DOCKER=1 rake artifact:all || error "rake artifact:all build failed." + +STACK_VERSION="$(./$(dirname "$0")/../common/qualified-version.sh)" +info "Build complete, setting STACK_VERSION to $STACK_VERSION." + info "Generated Artifacts" for file in build/logstash-*; do shasum $file;done diff --git a/.buildkite/scripts/dra/common.sh b/.buildkite/scripts/dra/common.sh index cdb6300a2..1ff6c5f8b 100755 --- a/.buildkite/scripts/dra/common.sh +++ b/.buildkite/scripts/dra/common.sh @@ -10,11 +10,7 @@ function error { function save_docker_tarballs { local arch="${1:?architecture required}" local version="${2:?stack-version required}" - local images="logstash logstash-oss" - if [ "${arch}" != "aarch64" ]; then - # No logstash-ubi8 for AARCH64 - images="logstash logstash-oss logstash-ubi8" - fi + local images="logstash logstash-oss logstash-wolfi" for image in ${images}; do tar_file="${image}-${version}-docker-image-${arch}.tar" @@ -29,16 +25,16 @@ function save_docker_tarballs { # Since we are using the system jruby, we need to make sure our jvm process # uses at least 1g of memory, If we don't do this we can get OOM issues when # installing gems. See https://github.com/elastic/logstash/issues/5179 -export JRUBY_OPTS="-J-Xmx1g" +export JRUBY_OPTS="-J-Xmx4g" # Extract the version number from the version.yml file # e.g.: 8.6.0 -# The suffix part like alpha1 etc is managed by the optional VERSION_QUALIFIER_OPT environment variable +# The suffix part like alpha1 etc is managed by the optional VERSION_QUALIFIER environment variable STACK_VERSION=`cat versions.yml | sed -n 's/^logstash\:[[:space:]]\([[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\)$/\1/p'` info "Agent is running on architecture [$(uname -i)]" -export VERSION_QUALIFIER_OPT=${VERSION_QUALIFIER_OPT:-""} +export VERSION_QUALIFIER=${VERSION_QUALIFIER:-""} export DRA_DRY_RUN=${DRA_DRY_RUN:-""} if [[ ! -z $DRA_DRY_RUN && $BUILDKITE_STEP_KEY == "logstash_publish_dra" ]]; then diff --git a/.buildkite/scripts/dra/generatesteps.py b/.buildkite/scripts/dra/generatesteps.py index db4b24ba6..85891e1b9 100644 --- a/.buildkite/scripts/dra/generatesteps.py +++ b/.buildkite/scripts/dra/generatesteps.py @@ -3,6 +3,8 @@ import sys import yaml +YAML_HEADER = '# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json\n' + def to_bk_key_friendly_string(key): """ Convert and return key to an acceptable format for Buildkite's key: field @@ -28,6 +30,8 @@ def package_x86_step(branch, workflow_type): export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:$PATH" eval "$(rbenv init -)" .buildkite/scripts/dra/build_packages.sh + artifact_paths: + - "**/*.hprof" ''' return step @@ -42,6 +46,8 @@ def package_x86_docker_step(branch, workflow_type): image: family/platform-ingest-logstash-ubuntu-2204 machineType: "n2-standard-16" diskSizeGb: 200 + artifact_paths: + - "**/*.hprof" command: | export WORKFLOW_TYPE="{workflow_type}" export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:$PATH" @@ -61,6 +67,8 @@ def package_aarch64_docker_step(branch, workflow_type): imagePrefix: platform-ingest-logstash-ubuntu-2204-aarch64 instanceType: "m6g.4xlarge" diskSizeGb: 200 + artifact_paths: + - "**/*.hprof" command: | export WORKFLOW_TYPE="{workflow_type}" export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:$PATH" @@ -106,6 +114,7 @@ def build_steps_to_yaml(branch, workflow_type): if __name__ == "__main__": try: workflow_type = os.environ["WORKFLOW_TYPE"] + version_qualifier = os.environ.get("VERSION_QUALIFIER", "") except ImportError: print(f"Missing env variable WORKFLOW_TYPE. Use export WORKFLOW_TYPE=\n.Exiting.") exit(1) @@ -114,18 +123,25 @@ if __name__ == "__main__": structure = {"steps": []} - # Group defining parallel steps that build and save artifacts - group_key = to_bk_key_friendly_string(f"logstash_dra_{workflow_type}") + if workflow_type.upper() == "SNAPSHOT" and len(version_qualifier)>0: + structure["steps"].append({ + "label": f"no-op pipeline because prerelease builds (VERSION_QUALIFIER is set to [{version_qualifier}]) don't support the [{workflow_type}] workflow", + "command": ":", + "skip": "VERSION_QUALIFIER (prerelease builds) not supported with SNAPSHOT DRA", + }) + else: + # Group defining parallel steps that build and save artifacts + group_key = to_bk_key_friendly_string(f"logstash_dra_{workflow_type}") - structure["steps"].append({ - "group": f":Build Artifacts - {workflow_type.upper()}", - "key": group_key, - "steps": build_steps_to_yaml(branch, workflow_type), - }) + structure["steps"].append({ + "group": f":Build Artifacts - {workflow_type.upper()}", + "key": group_key, + "steps": build_steps_to_yaml(branch, workflow_type), + }) - # Final step: pull artifacts built above and publish them via the release-manager - structure["steps"].extend( - yaml.safe_load(publish_dra_step(branch, workflow_type, depends_on=group_key)), - ) + # Final step: pull artifacts built above and publish them via the release-manager + structure["steps"].extend( + yaml.safe_load(publish_dra_step(branch, workflow_type, depends_on=group_key)), + ) - print('# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json\n' + yaml.dump(structure, Dumper=yaml.Dumper, sort_keys=False)) + print(YAML_HEADER + yaml.dump(structure, Dumper=yaml.Dumper, sort_keys=False)) diff --git a/.buildkite/scripts/dra/publish.sh b/.buildkite/scripts/dra/publish.sh index 598da84bb..c13cb411c 100755 --- a/.buildkite/scripts/dra/publish.sh +++ b/.buildkite/scripts/dra/publish.sh @@ -7,7 +7,9 @@ echo "####################################################################" source ./$(dirname "$0")/common.sh -PLAIN_STACK_VERSION=$STACK_VERSION +# DRA_BRANCH can be used for manually testing packaging with PRs +# e.g. define `DRA_BRANCH="main"` and `RUN_SNAPSHOT="true"` under Options/Environment Variables in the Buildkite UI after clicking new Build +BRANCH="${DRA_BRANCH:="${BUILDKITE_BRANCH:=""}"}" # This is the branch selector that needs to be passed to the release-manager # It has to be the name of the branch which originates the artifacts. @@ -15,29 +17,24 @@ RELEASE_VER=`cat versions.yml | sed -n 's/^logstash\:[[:space:]]\([[:digit:]]*\. if [ -n "$(git ls-remote --heads origin $RELEASE_VER)" ] ; then RELEASE_BRANCH=$RELEASE_VER else - RELEASE_BRANCH=main + RELEASE_BRANCH="${BRANCH:="main"}" fi +echo "RELEASE BRANCH: $RELEASE_BRANCH" -if [ -n "$VERSION_QUALIFIER_OPT" ]; then - # Qualifier is passed from CI as optional field and specify the version postfix - # in case of alpha or beta releases: - # e.g: 8.0.0-alpha1 - STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER_OPT}" - PLAIN_STACK_VERSION="${PLAIN_STACK_VERSION}-${VERSION_QUALIFIER_OPT}" -fi +VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}" case "$WORKFLOW_TYPE" in snapshot) - STACK_VERSION=${STACK_VERSION}-SNAPSHOT + : ;; staging) ;; *) - error "Worklflow (WORKFLOW_TYPE variable) is not set, exiting..." + error "Workflow (WORKFLOW_TYPE variable) is not set, exiting..." ;; esac -info "Uploading artifacts for ${WORKFLOW_TYPE} workflow on branch: ${RELEASE_BRANCH}" +info "Uploading artifacts for ${WORKFLOW_TYPE} workflow on branch: ${RELEASE_BRANCH} for version: ${STACK_VERSION} with version_qualifier: ${VERSION_QUALIFIER}" if [ "$RELEASE_VER" != "7.17" ]; then # Version 7.17.x doesn't generates ARM artifacts for Darwin @@ -45,17 +42,12 @@ if [ "$RELEASE_VER" != "7.17" ]; then : fi -# Deleting ubi8 for aarch64 for the time being. This image itself is not being built, and it is not expected -# by the release manager. -# See https://github.com/elastic/infra/blob/master/cd/release/release-manager/project-configs/8.5/logstash.gradle -# for more details. -# TODO filter it out when uploading artifacts instead -rm -f build/logstash-ubi8-${STACK_VERSION}-docker-image-aarch64.tar.gz - info "Downloaded ARTIFACTS sha report" for file in build/logstash-*; do shasum $file;done -mv build/distributions/dependencies-reports/logstash-${STACK_VERSION}.csv build/distributions/dependencies-${STACK_VERSION}.csv +FINAL_VERSION="$(./$(dirname "$0")/../common/qualified-version.sh)" + +mv build/distributions/dependencies-reports/logstash-${FINAL_VERSION}.csv build/distributions/dependencies-${FINAL_VERSION}.csv # set required permissions on artifacts and directory chmod -R a+r build/* @@ -73,6 +65,22 @@ release_manager_login # ensure the latest image has been pulled docker pull docker.elastic.co/infra/release-manager:latest +echo "+++ :clipboard: Listing DRA artifacts for version [$STACK_VERSION], branch [$RELEASE_BRANCH], workflow [$WORKFLOW_TYPE], QUALIFIER [$VERSION_QUALIFIER]" +docker run --rm \ + --name release-manager \ + -e VAULT_ROLE_ID \ + -e VAULT_SECRET_ID \ + --mount type=bind,readonly=false,src="$PWD",target=/artifacts \ + docker.elastic.co/infra/release-manager:latest \ + cli list \ + --project logstash \ + --branch "${RELEASE_BRANCH}" \ + --commit "$(git rev-parse HEAD)" \ + --workflow "${WORKFLOW_TYPE}" \ + --version "${STACK_VERSION}" \ + --artifact-set main \ + --qualifier "${VERSION_QUALIFIER}" + info "Running the release manager ..." # collect the artifacts for use with the unified build @@ -88,8 +96,9 @@ docker run --rm \ --branch ${RELEASE_BRANCH} \ --commit "$(git rev-parse HEAD)" \ --workflow "${WORKFLOW_TYPE}" \ - --version "${PLAIN_STACK_VERSION}" \ + --version "${STACK_VERSION}" \ --artifact-set main \ + --qualifier "${VERSION_QUALIFIER}" \ ${DRA_DRY_RUN} | tee rm-output.txt # extract the summary URL from a release manager output line like: diff --git a/.buildkite/scripts/exhaustive-tests/generate-steps.py b/.buildkite/scripts/exhaustive-tests/generate-steps.py index 6465467cf..c042985b1 100644 --- a/.buildkite/scripts/exhaustive-tests/generate-steps.py +++ b/.buildkite/scripts/exhaustive-tests/generate-steps.py @@ -10,7 +10,7 @@ from ruamel.yaml.scalarstring import LiteralScalarString VM_IMAGES_FILE = ".buildkite/scripts/common/vm-images.json" VM_IMAGE_PREFIX = "platform-ingest-logstash-multi-jdk-" -ACCEPTANCE_LINUX_OSES = ["ubuntu-2204", "ubuntu-2004", "debian-11", "debian-10", "rhel-8", "oraclelinux-7", "rocky-linux-8", "opensuse-leap-15", "amazonlinux-2023"] +ACCEPTANCE_LINUX_OSES = ["ubuntu-2404", "ubuntu-2204", "ubuntu-2004", "debian-11", "rhel-8", "oraclelinux-7", "rocky-linux-8", "opensuse-leap-15", "amazonlinux-2023"] CUR_PATH = os.path.dirname(os.path.abspath(__file__)) @@ -147,11 +147,6 @@ rake artifact:deb artifact:rpm set -eo pipefail source .buildkite/scripts/common/vm-agent-multi-jdk.sh source /etc/os-release -if [[ "$$(echo $$ID_LIKE | tr '[:upper:]' '[:lower:]')" =~ (rhel|fedora) && "$${VERSION_ID%.*}" -le 7 ]]; then - # jruby-9.3.10.0 unavailable on centos-7 / oel-7, see https://github.com/jruby/jruby/issues/7579#issuecomment-1425885324 / https://github.com/jruby/jruby/issues/7695 - # we only need a working jruby to run the acceptance test framework -- the packages have been prebuilt in a previous stage - rbenv local jruby-9.4.5.0 -fi ci/acceptance_tests.sh"""), } steps.append(step) @@ -160,7 +155,7 @@ ci/acceptance_tests.sh"""), def acceptance_docker_steps()-> list[typing.Any]: steps = [] - for flavor in ["full", "oss", "ubi8"]: + for flavor in ["full", "oss", "ubi", "wolfi"]: steps.append({ "label": f":docker: {flavor} flavor acceptance", "agents": gcp_agent(vm_name="ubuntu-2204", image_prefix="family/platform-ingest-logstash"), diff --git a/.buildkite/scripts/health-report-tests/README.md b/.buildkite/scripts/health-report-tests/README.md new file mode 100644 index 000000000..99bd198a8 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/README.md @@ -0,0 +1,18 @@ +## Description +This package for integration tests of the Health Report API. +Export `LS_BRANCH` to run on a specific branch. By default, it uses the main branch. + +## How to run the Health Report Integration test? +### Prerequisites +Make sure you have python installed. Install the integration test dependencies with the following command: +```shell +python3 -mpip install -r .buildkite/scripts/health-report-tests/requirements.txt +``` + +### Run the integration tests +```shell +python3 .buildkite/scripts/health-report-tests/main.py +``` + +### Troubleshooting +- If you get `WARNING: pip is configured with locations that require TLS/SSL,...` warning message, make sure you have python >=3.12.4 installed. \ No newline at end of file diff --git a/docs/static/pipeline-structure.asciidoc b/.buildkite/scripts/health-report-tests/__init__.py similarity index 100% rename from docs/static/pipeline-structure.asciidoc rename to .buildkite/scripts/health-report-tests/__init__.py diff --git a/.buildkite/scripts/health-report-tests/bootstrap.py b/.buildkite/scripts/health-report-tests/bootstrap.py new file mode 100644 index 000000000..5fa37a7bc --- /dev/null +++ b/.buildkite/scripts/health-report-tests/bootstrap.py @@ -0,0 +1,111 @@ +""" +Health Report Integration test bootstrapper with Python script + - A script to resolve Logstash version if not provided + - Download LS docker image and spin up + - When tests finished, teardown the Logstash +""" +import os +import subprocess +import time +import util +import yaml + + +class Bootstrap: + ELASTIC_STACK_RELEASED_VERSION_URL = "https://storage.googleapis.com/artifacts-api/releases/current/" + + def __init__(self) -> None: + f""" + A constructor of the {Bootstrap}. + Returns: + Resolves Logstash branch considering provided LS_BRANCH + Checks out git branch + """ + logstash_branch = os.environ.get("LS_BRANCH") + if logstash_branch is None: + # version is not specified, use the main branch, no need to git checkout + print(f"LS_BRANCH is not specified, using main branch.") + else: + # LS_BRANCH accepts major latest as a major.x or specific branch as X.Y + if logstash_branch.find(".x") == -1: + print(f"Using specified branch: {logstash_branch}") + util.git_check_out_branch(logstash_branch) + else: + major_version = logstash_branch.split(".")[0] + if major_version and major_version.isnumeric(): + resolved_version = self.__resolve_latest_stack_version_for(major_version) + minor_version = resolved_version.split(".")[1] + branch = major_version + "." + minor_version + print(f"Using resolved branch: {branch}") + util.git_check_out_branch(branch) + else: + raise ValueError(f"Invalid value set to LS_BRANCH. Please set it properly (ex: 8.x or 9.0) and " + f"rerun again") + + def __resolve_latest_stack_version_for(self, major_version: str) -> str: + resp = util.call_url_with_retry(self.ELASTIC_STACK_RELEASED_VERSION_URL + major_version) + release_version = resp.text.strip() + print(f"Resolved latest version for {major_version} is {release_version}.") + + if release_version == "": + raise ValueError(f"Cannot resolve latest version for {major_version} major") + return release_version + + def install_plugin(self, plugin_path: str) -> None: + util.run_or_raise_error( + ["bin/logstash-plugin", "install", plugin_path], + f"Failed to install {plugin_path}") + + def build_logstash(self): + print(f"Building Logstash...") + util.run_or_raise_error( + ["./gradlew", "clean", "bootstrap", "assemble", "installDefaultGems"], + "Failed to build Logstash") + print(f"Logstash has successfully built.") + + def apply_config(self, config: dict) -> None: + with open(os.getcwd() + "/.buildkite/scripts/health-report-tests/config/pipelines.yml", 'w') as pipelines_file: + yaml.dump(config, pipelines_file) + + def run_logstash(self, full_start_required: bool) -> subprocess.Popen: + # --config.reload.automatic is to make instance active + # it is helpful when testing crash pipeline cases + config_path = os.getcwd() + "/.buildkite/scripts/health-report-tests/config" + process = subprocess.Popen(["bin/logstash", "--config.reload.automatic", "--path.settings", config_path, + "-w 1"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=False) + if process.poll() is not None: + print(f"Logstash failed to run, check the the config and logs, then rerun.") + return None + + # Read stdout and stderr in real-time + logs = [] + for stdout_line in iter(process.stdout.readline, ""): + logs.append(stdout_line.strip()) + # we don't wait for Logstash fully start as we also test slow pipeline start scenarios + if full_start_required is False and "Starting pipeline" in stdout_line: + break + if full_start_required is True and "Pipeline started" in stdout_line: + break + if "Logstash shut down" in stdout_line or "Logstash stopped" in stdout_line: + print(f"Logstash couldn't spin up.") + print(logs) + return None + + print(f"Logstash is running with PID: {process.pid}.") + return process + + def stop_logstash(self, process: subprocess.Popen): + start_time = time.time() # in seconds + process.terminate() + for stdout_line in iter(process.stdout.readline, ""): + # print(f"STDOUT: {stdout_line.strip()}") + if "Logstash shut down" in stdout_line or "Logstash stopped" in stdout_line: + print(f"Logstash stopped.") + return None + # shudown watcher keep running, we should be good with considering time spent + if time.time() - start_time > 60: + print(f"Logstash didn't stop in 1min, sending SIGTERM signal.") + process.kill() + if time.time() - start_time > 70: + print(f"Logstash didn't stop over 1min, exiting.") + return None diff --git a/.buildkite/scripts/health-report-tests/config/pipelines.yml b/.buildkite/scripts/health-report-tests/config/pipelines.yml new file mode 100644 index 000000000..cfa2d9632 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/config/pipelines.yml @@ -0,0 +1 @@ +# Intentionally left blank \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/config_validator.py b/.buildkite/scripts/health-report-tests/config_validator.py new file mode 100644 index 000000000..be8795d69 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/config_validator.py @@ -0,0 +1,70 @@ +import yaml +from typing import Any, List, Dict + + +class ConfigValidator: + REQUIRED_KEYS = { + "root": ["name", "config", "conditions", "expectation"], + "config": ["pipeline.id", "config.string"], + "conditions": ["full_start_required", "wait_seconds"], + "expectation": ["status", "symptom", "indicators"], + "indicators": ["pipelines"], + "pipelines": ["status", "symptom", "indicators"], + "DYNAMIC": ["status", "symptom", "diagnosis", "impacts", "details"], # pipeline-id is a DYNAMIC + "details": ["status"], + "status": ["state"] + } + + def __init__(self): + self.yaml_content = None + + def __has_valid_keys(self, data: any, key_path: str, repeated: bool) -> bool: + # we reached the value + if isinstance(data, str) or isinstance(data, bool) or isinstance(data, int) or isinstance(data, float): + return True + + # we have two indicators section and for the next repeated ones, we go deeper + first_key = next(iter(data)) + data = data[first_key] if repeated and key_path == "indicators" else data + + if isinstance(data, dict): + # pipeline-id is a DYNAMIC + required = self.REQUIRED_KEYS.get("DYNAMIC" if repeated and key_path == "indicators" else key_path, []) + repeated = not repeated if key_path == "indicators" else repeated + for key in required: + if key not in data: + print(f"Missing key '{key}' in '{key_path}'") + return False + else: + dic_keys_result = self.__has_valid_keys(data[key], key, repeated) + if dic_keys_result is False: + return False + elif isinstance(data, list): + for item in data: + list_keys_result = self.__has_valid_keys(item, key_path, repeated) + if list_keys_result is False: + return False + return True + + def load(self, file_path: str) -> None: + """Load the YAML file content into self.yaml_content.""" + self.yaml_content: [Dict[str, Any]] = None + try: + with open(file_path, 'r') as file: + self.yaml_content = yaml.safe_load(file) + except yaml.YAMLError as exc: + print(f"Error in YAML file: {exc}") + self.yaml_content = None + + def is_valid(self) -> bool: + """Validate the entire YAML structure.""" + if self.yaml_content is None: + print(f"YAML content is empty.") + return False + + if not isinstance(self.yaml_content, dict): + print(f"YAML structure is not as expected, it should start with a Dict.") + return False + + result = self.__has_valid_keys(self.yaml_content, "root", False) + return True if result is True else False diff --git a/.buildkite/scripts/health-report-tests/logstash_health_report.py b/.buildkite/scripts/health-report-tests/logstash_health_report.py new file mode 100644 index 000000000..6b00cff07 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/logstash_health_report.py @@ -0,0 +1,16 @@ +""" +A class to provide information about Logstash node stats. +""" + +import util + + +class LogstashHealthReport: + LOGSTASH_HEALTH_REPORT_URL = "http://localhost:9600/_health_report" + + def __init__(self): + pass + + def get(self): + response = util.call_url_with_retry(self.LOGSTASH_HEALTH_REPORT_URL) + return response.json() diff --git a/.buildkite/scripts/health-report-tests/main.py b/.buildkite/scripts/health-report-tests/main.py new file mode 100644 index 000000000..52462f15b --- /dev/null +++ b/.buildkite/scripts/health-report-tests/main.py @@ -0,0 +1,89 @@ +""" + Main entry point of the LS health report API integration test suites +""" +import glob +import os +import time +import traceback +import yaml +from bootstrap import Bootstrap +from scenario_executor import ScenarioExecutor +from config_validator import ConfigValidator + + +class BootstrapContextManager: + + def __init__(self): + pass + + def __enter__(self): + print(f"Starting Logstash Health Report Integration test.") + self.bootstrap = Bootstrap() + self.bootstrap.build_logstash() + + plugin_path = os.getcwd() + "/qa/support/logstash-integration-failure_injector/logstash-integration" \ + "-failure_injector-*.gem" + matching_files = glob.glob(plugin_path) + if len(matching_files) == 0: + raise ValueError(f"Could not find logstash-integration-failure_injector plugin.") + + self.bootstrap.install_plugin(matching_files[0]) + print(f"logstash-integration-failure_injector successfully installed.") + return self.bootstrap + + def __exit__(self, exc_type, exc_value, exc_traceback): + if exc_type is not None: + print(traceback.format_exception(exc_type, exc_value, exc_traceback)) + + +def main(): + with BootstrapContextManager() as bootstrap: + scenario_executor = ScenarioExecutor() + config_validator = ConfigValidator() + + working_dir = os.getcwd() + scenario_files_path = working_dir + "/.buildkite/scripts/health-report-tests/tests/*.yaml" + scenario_files = glob.glob(scenario_files_path) + + for scenario_file in scenario_files: + print(f"Validating {scenario_file} scenario file.") + config_validator.load(scenario_file) + if config_validator.is_valid() is False: + print(f"{scenario_file} scenario file is not valid.") + return + else: + print(f"Validation succeeded.") + + has_failed_scenario = False + for scenario_file in scenario_files: + with open(scenario_file, 'r') as file: + # scenario_content: Dict[str, Any] = None + scenario_content = yaml.safe_load(file) + print(f"Testing `{scenario_content.get('name')}` scenario.") + scenario_name = scenario_content['name'] + + is_full_start_required = scenario_content.get('conditions').get('full_start_required') + wait_seconds = scenario_content.get('conditions').get('wait_seconds') + config = scenario_content['config'] + if config is not None: + bootstrap.apply_config(config) + expectations = scenario_content.get("expectation") + process = bootstrap.run_logstash(is_full_start_required) + if process is not None: + if wait_seconds is not None: + print(f"Test requires to wait for `{wait_seconds}` seconds.") + time.sleep(wait_seconds) # wait for Logstash to start + try: + scenario_executor.on(scenario_name, expectations) + except Exception as e: + print(e) + has_failed_scenario = True + bootstrap.stop_logstash(process) + + if has_failed_scenario: + # intentionally fail due to visibility + raise Exception("Some of scenarios failed, check the log for details.") + + +if __name__ == "__main__": + main() diff --git a/.buildkite/scripts/health-report-tests/main.sh b/.buildkite/scripts/health-report-tests/main.sh new file mode 100755 index 000000000..e6cbf3727 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/main.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euo pipefail + +export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:/opt/buildkite-agent/.java/bin:$PATH" +export JAVA_HOME="/opt/buildkite-agent/.java" +export PYENV_VERSION="3.11.5" + +eval "$(rbenv init -)" +eval "$(pyenv init -)" + +echo "--- Installing dependencies" +python3 -m pip install -r .buildkite/scripts/health-report-tests/requirements.txt + +echo "--- Running tests" +python3 .buildkite/scripts/health-report-tests/main.py \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/requirements.txt b/.buildkite/scripts/health-report-tests/requirements.txt new file mode 100644 index 000000000..c48e50211 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/requirements.txt @@ -0,0 +1,2 @@ +requests==2.32.3 +pyyaml==6.0.2 \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/scenario_executor.py b/.buildkite/scripts/health-report-tests/scenario_executor.py new file mode 100644 index 000000000..b5d8f7419 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/scenario_executor.py @@ -0,0 +1,67 @@ +""" +A class to execute the given scenario for Logstash Health Report integration test +""" +import time +from logstash_health_report import LogstashHealthReport + + +class ScenarioExecutor: + logstash_health_report_api = LogstashHealthReport() + + def __init__(self): + pass + + def __has_intersection(self, expects, results): + # TODO: this logic is aligned on current Health API response + # there is no guarantee that method correctly runs if provided multi expects and results + # we expect expects to be existing in results + for expect in expects: + for result in results: + if result.get('help_url') and "health-report-pipeline-" not in result.get('help_url'): + return False + if not all(key in result and result[key] == value for key, value in expect.items()): + return False + return True + + def __get_difference(self, differences: list, expectations: dict, reports: dict) -> dict: + for key in expectations.keys(): + + if type(expectations.get(key)) != type(reports.get(key)): + differences.append(f"Scenario expectation and Health API report structure differs for {key}.") + return differences + + if isinstance(expectations.get(key), str): + if expectations.get(key) != reports.get(key): + differences.append({key: {"expected": expectations.get(key), "got": reports.get(key)}}) + continue + elif isinstance(expectations.get(key), dict): + self.__get_difference(differences, expectations.get(key), reports.get(key)) + elif isinstance(expectations.get(key), list): + if not self.__has_intersection(expectations.get(key), reports.get(key)): + differences.append({key: {"expected": expectations.get(key), "got": reports.get(key)}}) + return differences + + def __is_expected(self, expectations: dict) -> None: + reports = self.logstash_health_report_api.get() + differences = self.__get_difference([], expectations, reports) + if differences: + print("Differences found in 'expectation' section between YAML content and stats:") + for diff in differences: + print(f"Difference: {diff}") + return False + else: + return True + + def on(self, scenario_name: str, expectations: dict) -> None: + # retriable check the expectations + attempts = 5 + while self.__is_expected(expectations) is False: + attempts = attempts - 1 + if attempts == 0: + break + time.sleep(1) + + if attempts == 0: + raise Exception(f"{scenario_name} failed.") + else: + print(f"Scenario `{scenario_name}` expectaion meets the health report stats.") diff --git a/.buildkite/scripts/health-report-tests/tests/abnormal-termination.yaml b/.buildkite/scripts/health-report-tests/tests/abnormal-termination.yaml new file mode 100644 index 000000000..8accc6528 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/tests/abnormal-termination.yaml @@ -0,0 +1,32 @@ +name: "Abnormally terminated pipeline" +config: + - pipeline.id: abnormally-terminated-pp + config.string: | + input { heartbeat { interval => 1 } } + filter { failure_injector { crash_at => filter } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 +conditions: + full_start_required: true + wait_seconds: 5 +expectation: + status: "red" + symptom: "1 indicator is unhealthy (`pipelines`)" + indicators: + pipelines: + status: "red" + symptom: "1 indicator is unhealthy (`abnormally-terminated-pp`)" + indicators: + abnormally-terminated-pp: + status: "red" + symptom: "The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - cause: "pipeline is not running, likely because it has encountered an error" + action: "view logs to determine the cause of abnormal pipeline shutdown" + impacts: + - description: "the pipeline is not currently processing" + impact_areas: ["pipeline_execution"] + details: + status: + state: "TERMINATED" \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/tests/backpressure-1m.yaml b/.buildkite/scripts/health-report-tests/tests/backpressure-1m.yaml new file mode 100644 index 000000000..446d17a36 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/tests/backpressure-1m.yaml @@ -0,0 +1,38 @@ +name: "Backpressured in 1min pipeline" +config: + - pipeline.id: backpressure-1m-pp + config.string: | + input { heartbeat { interval => 0.1 } } + filter { failure_injector { degrade_at => [filter] } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 +conditions: + full_start_required: true + wait_seconds: 70 # give more seconds to make sure time is over the threshold, 1m in this case +expectation: + status: "yellow" + symptom: "1 indicator is concerning (`pipelines`)" + indicators: + pipelines: + status: "yellow" + symptom: "1 indicator is concerning (`backpressure-1m-pp`)" + indicators: + backpressure-1m-pp: + status: "yellow" + symptom: "The pipeline is concerning; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - id: "logstash:health:pipeline:flow:worker_utilization:diagnosis:1m-blocked" + cause: "pipeline workers have been completely blocked for at least one minute" + action: "address bottleneck or add resources" + impacts: + - id: "logstash:health:pipeline:flow:impact:blocked_processing" + severity: 2 + description: "the pipeline is blocked" + impact_areas: ["pipeline_execution"] + details: + status: + state: "RUNNING" + flow: + worker_utilization: + last_1_minute: 100.0 \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/tests/backpressure-5m.yaml b/.buildkite/scripts/health-report-tests/tests/backpressure-5m.yaml new file mode 100644 index 000000000..3e33595fc --- /dev/null +++ b/.buildkite/scripts/health-report-tests/tests/backpressure-5m.yaml @@ -0,0 +1,39 @@ +name: "Backpressured in 5min pipeline" +config: + - pipeline.id: backpressure-5m-pp + config.string: | + input { heartbeat { interval => 0.1 } } + filter { failure_injector { degrade_at => [filter] } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 +conditions: + full_start_required: true + wait_seconds: 310 # give more seconds to make sure time is over the threshold, 1m in this case +expectation: + status: "red" + symptom: "1 indicator is unhealthy (`pipelines`)" + indicators: + pipelines: + status: "red" + symptom: "1 indicator is unhealthy (`backpressure-5m-pp`)" + indicators: + backpressure-5m-pp: + status: "red" + symptom: "The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - id: "logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-blocked" + cause: "pipeline workers have been completely blocked for at least five minutes" + action: "address bottleneck or add resources" + impacts: + - id: "logstash:health:pipeline:flow:impact:blocked_processing" + severity: 1 + description: "the pipeline is blocked" + impact_areas: ["pipeline_execution"] + details: + status: + state: "RUNNING" + flow: + worker_utilization: + last_1_minute: 100.0 + last_5_minutes: 100.0 \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/tests/multipipeline.yaml b/.buildkite/scripts/health-report-tests/tests/multipipeline.yaml new file mode 100644 index 000000000..42fd4ad95 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/tests/multipipeline.yaml @@ -0,0 +1,67 @@ +name: "Multi pipeline" +config: + - pipeline.id: slow-start-pp-multipipeline + config.string: | + input { heartbeat {} } + filter { failure_injector { degrade_at => [register] } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 + - pipeline.id: normally-terminated-pp-multipipeline + config.string: | + input { generator { count => 1 } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 + - pipeline.id: abnormally-terminated-pp-multipipeline + config.string: | + input { heartbeat { interval => 1 } } + filter { failure_injector { crash_at => filter } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 +conditions: + full_start_required: false + wait_seconds: 10 +expectation: + status: "red" + symptom: "1 indicator is unhealthy (`pipelines`)" + indicators: + pipelines: + status: "red" + symptom: "1 indicator is unhealthy (`abnormally-terminated-pp-multipipeline`) and 2 indicators are concerning (`slow-start-pp-multipipeline`, `normally-terminated-pp-multipipeline`)" + indicators: + slow-start-pp-multipipeline: + status: "yellow" + symptom: "The pipeline is concerning; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - cause: "pipeline is loading" + action: "if pipeline does not come up quickly, you may need to check the logs to see if it is stalled" + impacts: + - impact_areas: ["pipeline_execution"] + details: + status: + state: "LOADING" + normally-terminated-pp-multipipeline: + status: "yellow" + symptom: "The pipeline is concerning; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - cause: "pipeline has finished running because its inputs have been closed and events have been processed" + action: "if you expect this pipeline to run indefinitely, you will need to configure its inputs to continue receiving or fetching events" + impacts: + - impact_areas: [ "pipeline_execution" ] + details: + status: + state: "FINISHED" + abnormally-terminated-pp-multipipeline: + status: "red" + symptom: "The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - cause: "pipeline is not running, likely because it has encountered an error" + action: "view logs to determine the cause of abnormal pipeline shutdown" + impacts: + - description: "the pipeline is not currently processing" + impact_areas: [ "pipeline_execution" ] + details: + status: + state: "TERMINATED" \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/tests/normal-termination.yaml b/.buildkite/scripts/health-report-tests/tests/normal-termination.yaml new file mode 100644 index 000000000..aa499b44f --- /dev/null +++ b/.buildkite/scripts/health-report-tests/tests/normal-termination.yaml @@ -0,0 +1,30 @@ +name: "Successfully terminated pipeline" +config: + - pipeline.id: normally-terminated-pp + config.string: | + input { generator { count => 1 } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 +conditions: + full_start_required: true + wait_seconds: 5 +expectation: + status: "yellow" + symptom: "1 indicator is concerning (`pipelines`)" + indicators: + pipelines: + status: "yellow" + symptom: "1 indicator is concerning (`normally-terminated-pp`)" + indicators: + normally-terminated-pp: + status: "yellow" + symptom: "The pipeline is concerning; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - cause: "pipeline has finished running because its inputs have been closed and events have been processed" + action: "if you expect this pipeline to run indefinitely, you will need to configure its inputs to continue receiving or fetching events" + impacts: + - impact_areas: ["pipeline_execution"] + details: + status: + state: "FINISHED" \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/tests/slow-start.yaml b/.buildkite/scripts/health-report-tests/tests/slow-start.yaml new file mode 100644 index 000000000..5343dc9a1 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/tests/slow-start.yaml @@ -0,0 +1,31 @@ +name: "Slow start pipeline" +config: + - pipeline.id: slow-start-pp + config.string: | + input { heartbeat {} } + filter { failure_injector { degrade_at => [register] } } + output { stdout {} } + pipeline.workers: 1 + pipeline.batch.size: 1 +conditions: + full_start_required: false + wait_seconds: 0 +expectation: + status: "yellow" + symptom: "1 indicator is concerning (`pipelines`)" + indicators: + pipelines: + status: "yellow" + symptom: "1 indicator is concerning (`slow-start-pp`)" + indicators: + slow-start-pp: + status: "yellow" + symptom: "The pipeline is concerning; 1 area is impacted and 1 diagnosis is available" + diagnosis: + - cause: "pipeline is loading" + action: "if pipeline does not come up quickly, you may need to check the logs to see if it is stalled" + impacts: + - impact_areas: ["pipeline_execution"] + details: + status: + state: "LOADING" \ No newline at end of file diff --git a/.buildkite/scripts/health-report-tests/util.py b/.buildkite/scripts/health-report-tests/util.py new file mode 100644 index 000000000..86db9d571 --- /dev/null +++ b/.buildkite/scripts/health-report-tests/util.py @@ -0,0 +1,36 @@ +import os +import requests +import subprocess +from requests.adapters import HTTPAdapter, Retry + + +def call_url_with_retry(url: str, max_retries: int = 5, delay: int = 1) -> requests.Response: + f""" + Calls the given {url} with maximum of {max_retries} retries with {delay} delay. + """ + schema = "https://" if "https://" in url else "http://" + session = requests.Session() + # retry on most common failures such as connection timeout(408), etc... + retries = Retry(total=max_retries, backoff_factor=delay, status_forcelist=[408, 502, 503, 504]) + session.mount(schema, HTTPAdapter(max_retries=retries)) + return session.get(url) + + +def git_check_out_branch(branch_name: str) -> None: + f""" + Checks out specified branch or fails with error if checkout operation fails. + """ + run_or_raise_error(["git", "checkout", branch_name], + "Error occurred while checking out the " + branch_name + " branch") + + +def run_or_raise_error(commands: list, error_message): + f""" + Executes the {list} commands and raises an {Exception} if opration fails. + """ + result = subprocess.run(commands, env=os.environ.copy(), universal_newlines=True, stdout=subprocess.PIPE) + if result.returncode != 0: + full_error_message = (error_message + ", output: " + result.stdout.decode('utf-8')) \ + if result.stdout else error_message + raise Exception(f"{full_error_message}") + diff --git a/.buildkite/scripts/jdk-matrix-tests/generate-steps.py b/.buildkite/scripts/jdk-matrix-tests/generate-steps.py index 681272b85..cbb490035 100644 --- a/.buildkite/scripts/jdk-matrix-tests/generate-steps.py +++ b/.buildkite/scripts/jdk-matrix-tests/generate-steps.py @@ -4,6 +4,7 @@ from dataclasses import dataclass, field import os import sys import typing +from functools import partial from ruamel.yaml import YAML from ruamel.yaml.scalarstring import LiteralScalarString @@ -177,17 +178,15 @@ class LinuxJobs(Jobs): super().__init__(os=os, jdk=jdk, group_key=group_key, agent=agent) def all_jobs(self) -> list[typing.Callable[[], JobRetValues]]: - return [ - self.init_annotation, - self.java_unit_test, - self.ruby_unit_test, - self.integration_tests_part_1, - self.integration_tests_part_2, - self.pq_integration_tests_part_1, - self.pq_integration_tests_part_2, - self.x_pack_unit_tests, - self.x_pack_integration, - ] + jobs=list() + jobs.append(self.init_annotation) + jobs.append(self.java_unit_test) + jobs.append(self.ruby_unit_test) + jobs.extend(self.integration_test_parts(3)) + jobs.extend(self.pq_integration_test_parts(3)) + jobs.append(self.x_pack_unit_tests) + jobs.append(self.x_pack_integration) + return jobs def prepare_shell(self) -> str: jdk_dir = f"/opt/buildkite-agent/.java/{self.jdk}" @@ -259,17 +258,14 @@ ci/unit_tests.sh ruby retry=copy.deepcopy(ENABLED_RETRIES), ) - def integration_tests_part_1(self) -> JobRetValues: - return self.integration_tests(part=1) + def integration_test_parts(self, parts) -> list[partial[JobRetValues]]: + return [partial(self.integration_tests, part=idx+1, parts=parts) for idx in range(parts)] - def integration_tests_part_2(self) -> JobRetValues: - return self.integration_tests(part=2) - - def integration_tests(self, part: int) -> JobRetValues: - step_name_human = f"Integration Tests - {part}" - step_key = f"{self.group_key}-integration-tests-{part}" + def integration_tests(self, part: int, parts: int) -> JobRetValues: + step_name_human = f"Integration Tests - {part}/{parts}" + step_key = f"{self.group_key}-integration-tests-{part}-of-{parts}" test_command = f""" -ci/integration_tests.sh split {part-1} +ci/integration_tests.sh split {part-1} {parts} """ return JobRetValues( @@ -281,18 +277,15 @@ ci/integration_tests.sh split {part-1} retry=copy.deepcopy(ENABLED_RETRIES), ) - def pq_integration_tests_part_1(self) -> JobRetValues: - return self.pq_integration_tests(part=1) + def pq_integration_test_parts(self, parts) -> list[partial[JobRetValues]]: + return [partial(self.pq_integration_tests, part=idx+1, parts=parts) for idx in range(parts)] - def pq_integration_tests_part_2(self) -> JobRetValues: - return self.pq_integration_tests(part=2) - - def pq_integration_tests(self, part: int) -> JobRetValues: - step_name_human = f"IT Persistent Queues - {part}" - step_key = f"{self.group_key}-it-persistent-queues-{part}" + def pq_integration_tests(self, part: int, parts: int) -> JobRetValues: + step_name_human = f"IT Persistent Queues - {part}/{parts}" + step_key = f"{self.group_key}-it-persistent-queues-{part}-of-{parts}" test_command = f""" export FEATURE_FLAG=persistent_queues -ci/integration_tests.sh split {part-1} +ci/integration_tests.sh split {part-1} {parts} """ return JobRetValues( diff --git a/.buildkite/scripts/setup_java.sh b/.buildkite/scripts/setup_java.sh index 6a0ae591d..3ba20201c 100755 --- a/.buildkite/scripts/setup_java.sh +++ b/.buildkite/scripts/setup_java.sh @@ -4,7 +4,7 @@ set -e install_java() { # TODO: let's think about regularly creating a custom image for Logstash which may align on version.yml definitions - sudo apt update && sudo apt install -y openjdk-17-jdk && sudo apt install -y openjdk-17-jre + sudo apt update && sudo apt install -y openjdk-21-jdk && sudo apt install -y openjdk-21-jre } install_java diff --git a/.buildkite/scripts/snyk/report.sh b/.buildkite/scripts/snyk/report.sh index 7dab7c5e3..529fd887b 100755 --- a/.buildkite/scripts/snyk/report.sh +++ b/.buildkite/scripts/snyk/report.sh @@ -4,22 +4,13 @@ set -e TARGET_BRANCHES=("main") -install_java() { - # TODO: let's think about using BK agent which has Java installed - # Current caveat is Logstash BK agent doesn't support docker operatioins in it - sudo apt update && sudo apt install -y openjdk-17-jdk && sudo apt install -y openjdk-17-jre +install_java_11() { + curl -L -s "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.24_8.tar.gz" | tar -zxf - } # Resolves the branches we are going to track resolve_latest_branches() { source .buildkite/scripts/snyk/resolve_stack_version.sh - for SNAPSHOT_VERSION in "${SNAPSHOT_VERSIONS[@]}" - do - IFS='.' - read -a versions <<< "$SNAPSHOT_VERSION" - version=${versions[0]}.${versions[1]} - TARGET_BRANCHES+=("$version") - done } # Build Logstash specific branch to generate Gemlock file where Snyk scans @@ -42,7 +33,7 @@ download_auth_snyk() { report() { REMOTE_REPO_URL=$1 echo "Reporting $REMOTE_REPO_URL branch." - if [ "$REMOTE_REPO_URL" != "main" ]; then + if [ "$REMOTE_REPO_URL" != "main" ] && [ "$REMOTE_REPO_URL" != "8.x" ]; then MAJOR_VERSION=$(echo "$REMOTE_REPO_URL"| cut -d'.' -f 1) REMOTE_REPO_URL="$MAJOR_VERSION".latest echo "Using '$REMOTE_REPO_URL' remote repo url." @@ -55,13 +46,18 @@ report() { ./snyk monitor --prune-repeated-subdependencies --all-projects --org=logstash --remote-repo-url="$REMOTE_REPO_URL" --target-reference="$REMOTE_REPO_URL" --detection-depth=6 --exclude=qa,tools,devtools,requirements.txt --project-tags=branch="$TARGET_BRANCH",git_head="$GIT_HEAD" || : } -install_java resolve_latest_branches download_auth_snyk # clone Logstash repo, build and report for TARGET_BRANCH in "${TARGET_BRANCHES[@]}" do + if [ "$TARGET_BRANCH" == "7.17" ]; then + echo "Installing and configuring JDK11." + export OLD_PATH=$PATH + install_java_11 + export PATH=$PWD/jdk-11.0.24+8/bin:$PATH + fi git reset --hard HEAD # reset if any generated files appeared # check if target branch exists echo "Checking out $TARGET_BRANCH branch." @@ -71,70 +67,10 @@ do else echo "$TARGET_BRANCH branch doesn't exist." fi -done - -# Scan Logstash docker images and report -REPOSITORY_BASE_URL="docker.elastic.co/logstash/" - -report_docker_image() { - image=$1 - project_name=$2 - platform=$3 - echo "Reporting $image to Snyk started..." - docker pull "$image" - if [[ $platform != null ]]; then - ./snyk container monitor "$image" --org=logstash --platform="$platform" --project-name="$project_name" --project-tags=version="$version" || : - else - ./snyk container monitor "$image" --org=logstash --project-name="$project_name" --project-tags=version="$version" || : + if [ "$TARGET_BRANCH" == "7.17" ]; then + # reset state + echo "Removing JDK11 installation." + rm -rf jdk-11.0.24+8 + export PATH=$OLD_PATH fi -} - -report_docker_images() { - version=$1 - echo "Version value: $version" - - image=$REPOSITORY_BASE_URL"logstash:$version-SNAPSHOT" - snyk_project_name="logstash-$version-SNAPSHOT" - report_docker_image "$image" "$snyk_project_name" - - image=$REPOSITORY_BASE_URL"logstash-oss:$version-SNAPSHOT" - snyk_project_name="logstash-oss-$version-SNAPSHOT" - report_docker_image "$image" "$snyk_project_name" - - image=$REPOSITORY_BASE_URL"logstash:$version-SNAPSHOT-arm64" - snyk_project_name="logstash-$version-SNAPSHOT-arm64" - report_docker_image "$image" "$snyk_project_name" "linux/arm64" - - image=$REPOSITORY_BASE_URL"logstash:$version-SNAPSHOT-amd64" - snyk_project_name="logstash-$version-SNAPSHOT-amd64" - report_docker_image "$image" "$snyk_project_name" "linux/amd64" - - image=$REPOSITORY_BASE_URL"logstash-oss:$version-SNAPSHOT-arm64" - snyk_project_name="logstash-oss-$version-SNAPSHOT-arm64" - report_docker_image "$image" "$snyk_project_name" "linux/arm64" - - image=$REPOSITORY_BASE_URL"logstash-oss:$version-SNAPSHOT-amd64" - snyk_project_name="logstash-oss-$version-SNAPSHOT-amd64" - report_docker_image "$image" "$snyk_project_name" "linux/amd64" -} - -resolve_version_and_report_docker_images() { - git reset --hard HEAD # reset if any generated files appeared - git checkout "$1" - - # parse version (ex: 8.8.2 from 8.8 branch, or 8.9.0 from main branch) - versions_file="$PWD/versions.yml" - version=$(awk '/logstash:/ { print $2 }' "$versions_file") - report_docker_images "$version" -} - -# resolve docker artifact and report -#for TARGET_BRANCH in "${TARGET_BRANCHES[@]}" -#do -# if git show-ref --quiet refs/heads/"$TARGET_BRANCH"; then -# echo "Using $TARGET_BRANCH branch for docker images." -# resolve_version_and_report_docker_images "$TARGET_BRANCH" -# else -# echo "$TARGET_BRANCH branch doesn't exist." -# fi -#done \ No newline at end of file +done diff --git a/.buildkite/scripts/snyk/resolve_stack_version.sh b/.buildkite/scripts/snyk/resolve_stack_version.sh index 5430fe8e1..06da9baa5 100755 --- a/.buildkite/scripts/snyk/resolve_stack_version.sh +++ b/.buildkite/scripts/snyk/resolve_stack_version.sh @@ -6,14 +6,9 @@ set -e -VERSION_URL="https://raw.githubusercontent.com/elastic/logstash/main/ci/logstash_releases.json" +VERSION_URL="https://storage.googleapis.com/artifacts-api/snapshots/branches.json" echo "Fetching versions from $VERSION_URL" -VERSIONS=$(curl --silent $VERSION_URL) -SNAPSHOT_KEYS=$(echo "$VERSIONS" | jq -r '.snapshots | .[]') +readarray -t TARGET_BRANCHES < <(curl --retry-all-errors --retry 5 --retry-delay 5 -fsSL $VERSION_URL | jq -r '.branches[]') +echo "${TARGET_BRANCHES[@]}" -SNAPSHOT_VERSIONS=() -while IFS= read -r line; do - SNAPSHOT_VERSIONS+=("$line") - echo "Resolved snapshot version: $line" -done <<< "$SNAPSHOT_KEYS" \ No newline at end of file diff --git a/.buildkite/snyk_report_pipeline.yml b/.buildkite/snyk_report_pipeline.yml index f4306bc1f..4f541256a 100644 --- a/.buildkite/snyk_report_pipeline.yml +++ b/.buildkite/snyk_report_pipeline.yml @@ -1,12 +1,14 @@ agents: - provider: gcp - imageProject: elastic-images-prod - image: family/platform-ingest-logstash-ubuntu-2204 - machineType: "n2-standard-4" - diskSizeGb: 120 + image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci" + cpu: "2" + memory: "4Gi" + ephemeralStorage: "64Gi" steps: # reports main, previous (ex: 7.latest) and current (ex: 8.latest) release branches to Snyk - label: ":hammer: Report to Snyk" command: - - .buildkite/scripts/snyk/report.sh \ No newline at end of file + - .buildkite/scripts/snyk/report.sh + retry: + automatic: + - limit: 3 diff --git a/.buildkite/windows_jdk_matrix_pipeline.yml b/.buildkite/windows_jdk_matrix_pipeline.yml index 2c336e141..a1578c5ea 100644 --- a/.buildkite/windows_jdk_matrix_pipeline.yml +++ b/.buildkite/windows_jdk_matrix_pipeline.yml @@ -2,7 +2,7 @@ env: DEFAULT_MATRIX_OS: "windows-2022" - DEFAULT_MATRIX_JDK: "adoptiumjdk_17" + DEFAULT_MATRIX_JDK: "adoptiumjdk_21" steps: - input: "Test Parameters" @@ -15,6 +15,8 @@ steps: multiple: true default: "${DEFAULT_MATRIX_OS}" options: + - label: "Windows 2025" + value: "windows-2025" - label: "Windows 2022" value: "windows-2022" - label: "Windows 2019" @@ -33,20 +35,14 @@ steps: value: "adoptiumjdk_21" - label: "Adoptium JDK 17 (Eclipse Temurin)" value: "adoptiumjdk_17" - - label: "Adoptium JDK 11 (Eclipse Temurin)" - value: "adoptiumjdk_11" - label: "OpenJDK 21" value: "openjdk_21" - label: "OpenJDK 17" value: "openjdk_17" - - label: "OpenJDK 11" - value: "openjdk_11" - label: "Zulu 21" value: "zulu_21" - label: "Zulu 17" value: "zulu_17" - - label: "Zulu 11" - value: "zulu_11" - wait: ~ if: build.source != "schedule" && build.source != "trigger_job" diff --git a/.ci/Makefile b/.ci/Makefile new file mode 100644 index 000000000..c826b724e --- /dev/null +++ b/.ci/Makefile @@ -0,0 +1,42 @@ +.SILENT: +MAKEFLAGS += --no-print-directory +.SHELLFLAGS = -euc +SHELL = /bin/bash + +####################### +## Templates +####################### +## Mergify template +define MERGIFY_TMPL + + - name: backport patches to $(BRANCH) branch + conditions: + - merged + - base=main + - label=$(BACKPORT_LABEL) + actions: + backport: + branches: + - "$(BRANCH)" +endef + +# Add mergify entry for the new backport label +.PHONY: mergify +export MERGIFY_TMPL +mergify: BACKPORT_LABEL=$${BACKPORT_LABEL} BRANCH=$${BRANCH} PUSH_BRANCH=$${PUSH_BRANCH} +mergify: + @echo ">> mergify" + echo "$$MERGIFY_TMPL" >> ../.mergify.yml + git add ../.mergify.yml + git status + if [ ! -z "$$(git status --porcelain)" ]; then \ + git commit -m "mergify: add $(BACKPORT_LABEL) rule"; \ + git push origin $(PUSH_BRANCH) ; \ + fi + +# Create GitHub backport label +.PHONY: backport-label +backport-label: BACKPORT_LABEL=$${BACKPORT_LABEL} +backport-label: + @echo ">> backport-label" + gh label create $(BACKPORT_LABEL) --description "Automated backport with mergify" --color 0052cc --force diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index 37bb73de6..0ca3d870d 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -1,2 +1,2 @@ -LS_BUILD_JAVA=adoptiumjdk_17 -LS_RUNTIME_JAVA=adoptiumjdk_17 +LS_BUILD_JAVA=adoptiumjdk_21 +LS_RUNTIME_JAVA=adoptiumjdk_21 diff --git a/.fossa.yml b/.fossa.yml index 55e69801b..60fd562b6 100755 --- a/.fossa.yml +++ b/.fossa.yml @@ -21,10 +21,6 @@ analyze: type: gradle target: 'dependencies-report:' path: . - - name: ingest-converter - type: gradle - target: 'ingest-converter:' - path: . - name: logstash-core type: gradle target: 'logstash-core:' diff --git a/.github/ISSUE_TEMPLATE/test-failure.md b/.github/ISSUE_TEMPLATE/test-failure.md index 96b43f986..6e6023e45 100644 --- a/.github/ISSUE_TEMPLATE/test-failure.md +++ b/.github/ISSUE_TEMPLATE/test-failure.md @@ -21,6 +21,5 @@ to reproduce locally **Failure history**: **Failure excerpt**: diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..ee85a87f6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directories: + - '/' + - '/.github/actions/*' + schedule: + interval: "weekly" + day: "sunday" + time: "22:00" + reviewers: + - "elastic/observablt-ci" + - "elastic/observablt-ci-contractors" + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/add-docs-preview-link.yml b/.github/workflows/add-docs-preview-link.yml deleted file mode 100644 index b99a9fdce..000000000 --- a/.github/workflows/add-docs-preview-link.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Docs Preview Link - -on: - pull_request_target: - types: [opened, synchronize] - paths: - - docs/** - - docsk8s/** -jobs: - docs-preview-link: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - id: wait-for-status - uses: autotelic/action-wait-for-status-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - owner: elastic - # when running with on: pull_request_target we get the PR base ref by default - ref: ${{ github.event.pull_request.head.sha }} - statusName: "buildkite/docs-build-pr" - # https://elasticsearch-ci.elastic.co/job/elastic+logstash+pull-request+build-docs - # usually finishes in ~ 20 minutes - timeoutSeconds: 900 - intervalSeconds: 30 - - name: Add Docs Preview link in PR Comment - if: steps.wait-for-status.outputs.state == 'success' - uses: thollander/actions-comment-pull-request@v1 - with: - message: | - :page_with_curl: **DOCS PREVIEW** :sparkles: https://logstash_bk_${{ github.event.number }}.docs-preview.app.elstc.co/diff - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/backport-active.yml b/.github/workflows/backport-active.yml new file mode 100644 index 000000000..a0f563fea --- /dev/null +++ b/.github/workflows/backport-active.yml @@ -0,0 +1,22 @@ +name: Backport to active branches + +on: + pull_request_target: + types: [closed] + branches: + - main + +permissions: + pull-requests: write + contents: read + +jobs: + backport: + # Only run if the PR was merged (not just closed) and has one of the backport labels + if: | + github.event.pull_request.merged == true && + contains(toJSON(github.event.pull_request.labels.*.name), 'backport-active-') + runs-on: ubuntu-latest + + steps: + - uses: elastic/oblt-actions/github/backport-active@v1 diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml new file mode 100644 index 000000000..bb466166d --- /dev/null +++ b/.github/workflows/docs-build.yml @@ -0,0 +1,19 @@ +name: docs-build + +on: + push: + branches: + - main + pull_request_target: ~ + merge_group: ~ + +jobs: + docs-preview: + uses: elastic/docs-builder/.github/workflows/preview-build.yml@main + with: + path-pattern: docs/** + permissions: + deployments: write + id-token: write + contents: read + pull-requests: read diff --git a/.github/workflows/docs-cleanup.yml b/.github/workflows/docs-cleanup.yml new file mode 100644 index 000000000..f83e017b5 --- /dev/null +++ b/.github/workflows/docs-cleanup.yml @@ -0,0 +1,14 @@ +name: docs-cleanup + +on: + pull_request_target: + types: + - closed + +jobs: + docs-preview: + uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main + permissions: + contents: none + id-token: write + deployments: write diff --git a/.github/workflows/mergify-labels-copier.yml b/.github/workflows/mergify-labels-copier.yml new file mode 100644 index 000000000..d5ff3ed0e --- /dev/null +++ b/.github/workflows/mergify-labels-copier.yml @@ -0,0 +1,23 @@ +name: mergify backport labels copier + +on: + pull_request: + types: + - opened + +permissions: + contents: read + +jobs: + mergify-backport-labels-copier: + runs-on: ubuntu-latest + if: startsWith(github.head_ref, 'mergify/bp/') + permissions: + # Add GH labels + pull-requests: write + # See https://github.com/cli/cli/issues/6274 + repository-projects: read + steps: + - uses: elastic/oblt-actions/mergify/labels-copier@v1 + with: + excluded-labels-regex: "^backport-*" diff --git a/.github/workflows/pr_backporter.yml b/.github/workflows/pr_backporter.yml deleted file mode 100644 index 09fea3c53..000000000 --- a/.github/workflows/pr_backporter.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Backport PR to another branch -on: - issue_comment: - types: [created] - -permissions: - pull-requests: write - contents: write - -jobs: - pr_commented: - name: PR comment - if: github.event.issue.pull_request - runs-on: ubuntu-latest - steps: - - uses: actions-ecosystem/action-regex-match@v2 - id: regex-match - with: - text: ${{ github.event.comment.body }} - regex: '^@logstashmachine backport (main|[x0-9\.]+)$' - - if: ${{ steps.regex-match.outputs.group1 == '' }} - run: exit 1 - - name: Fetch logstash-core team member list - uses: tspascoal/get-user-teams-membership@v1 - id: checkUserMember - with: - username: ${{ github.actor }} - organization: elastic - team: logstash - GITHUB_TOKEN: ${{ secrets.READ_ORG_SECRET_JSVD }} - - name: Is user not a core team member? - if: ${{ steps.checkUserMember.outputs.isTeamMember == 'false' }} - run: exit 1 - - name: checkout repo content - uses: actions/checkout@v2 - with: - fetch-depth: 0 - ref: 'main' - - run: git config --global user.email "43502315+logstashmachine@users.noreply.github.com" - - run: git config --global user.name "logstashmachine" - - name: setup python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - run: | - mkdir ~/.elastic && echo ${{ github.token }} >> ~/.elastic/github.token - - run: pip install requests - - name: run backport - run: python devtools/backport ${{ steps.regex-match.outputs.group1 }} ${{ github.event.issue.number }} --remote=origin --yes diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..23545b29c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,18 @@ +name: pre-commit + +on: + pull_request: + push: + branches: + - main + - 8.* + - 9.* + +permissions: + contents: read + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: elastic/oblt-actions/pre-commit@v1 diff --git a/.github/workflows/version_bumps.yml b/.github/workflows/version_bumps.yml index a888bcc9c..e674c0b6c 100644 --- a/.github/workflows/version_bumps.yml +++ b/.github/workflows/version_bumps.yml @@ -25,9 +25,13 @@ jobs: version_bumper: name: Bump versions runs-on: ubuntu-latest + env: + INPUTS_BRANCH: "${{ inputs.branch }}" + INPUTS_BUMP: "${{ inputs.bump }}" + BACKPORT_LABEL: "backport-${{ inputs.branch }}" steps: - name: Fetch logstash-core team member list - uses: tspascoal/get-user-teams-membership@v1 + uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 #v3.0.0 with: username: ${{ github.actor }} organization: elastic @@ -37,14 +41,14 @@ jobs: if: ${{ steps.checkUserMember.outputs.isTeamMember == 'false' }} run: exit 1 - name: checkout repo content - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.inputs.branch }} + ref: ${{ env.INPUTS_BRANCH }} - run: git config --global user.email "43502315+logstashmachine@users.noreply.github.com" - run: git config --global user.name "logstashmachine" - run: ./gradlew clean installDefaultGems - - run: ./vendor/jruby/bin/jruby -S bundle update --all --${{ github.event.inputs.bump }} --strict + - run: ./vendor/jruby/bin/jruby -S bundle update --all --${{ env.INPUTS_BUMP }} --strict - run: mv Gemfile.lock Gemfile.jruby-*.lock.release - run: echo "T=$(date +%s)" >> $GITHUB_ENV - run: echo "BRANCH=update_lock_${T}" >> $GITHUB_ENV @@ -53,8 +57,21 @@ jobs: git add . git status if [[ -z $(git status --porcelain) ]]; then echo "No changes. We're done."; exit 0; fi - git commit -m "Update ${{ github.event.inputs.bump }} plugin versions in gemfile lock" -a + git commit -m "Update ${{ env.INPUTS_BUMP }} plugin versions in gemfile lock" -a git push origin $BRANCH + + - name: Update mergify (minor only) + if: ${{ inputs.bump == 'minor' }} + continue-on-error: true + run: make -C .ci mergify BACKPORT_LABEL=$BACKPORT_LABEL BRANCH=$INPUTS_BRANCH PUSH_BRANCH=$BRANCH + - name: Create Pull Request run: | - curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d "{\"title\": \"bump lock file for ${{ github.event.inputs.branch }}\",\"head\": \"${BRANCH}\",\"base\": \"${{ github.event.inputs.branch }}\"}" https://api.github.com/repos/elastic/logstash/pulls + curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d "{\"title\": \"bump lock file for ${{ env.INPUTS_BRANCH }}\",\"head\": \"${BRANCH}\",\"base\": \"${{ env.INPUTS_BRANCH }}\"}" https://api.github.com/repos/elastic/logstash/pulls + + - name: Create GitHub backport label (Mergify) (minor only) + if: ${{ inputs.bump == 'minor' }} + continue-on-error: true + run: make -C .ci backport-label BACKPORT_LABEL=$BACKPORT_LABEL + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 000000000..9c724e109 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,132 @@ +commands_restrictions: + backport: + conditions: + - or: + - sender-permission>=write + - sender=github-actions[bot] +defaults: + actions: + backport: + title: "[{{ destination_branch }}] (backport #{{ number }}) {{ title }}" + assignees: + - "{{ author }}" + labels: + - "backport" +pull_request_rules: +# - name: ask to resolve conflict +# conditions: +# - conflict +# actions: +# comment: +# message: | +# This pull request is now in conflicts. Could you fix it @{{author}}? 🙏 +# To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/ +# ``` +# git fetch upstream +# git checkout -b {{head}} upstream/{{head}} +# git merge upstream/{{base}} +# git push upstream {{head}} +# ``` + + - name: notify the backport policy + conditions: + - -label~=^backport + - base=main + actions: + comment: + message: | + This pull request does not have a backport label. Could you fix it @{{author}}? 🙏 + To fixup this pull request, you need to add the backport labels for the needed + branches, such as: + * `backport-8./d` is the label to automatically backport to the `8./d` branch. `/d` is the digit. + * If no backport is necessary, please add the `backport-skip` label + + - name: remove backport-skip label + conditions: + - label~=^backport-\d + actions: + label: + remove: + - backport-skip + + - name: notify the backport has not been merged yet + conditions: + - -merged + - -closed + - author=mergify[bot] + - "#check-success>0" + - schedule=Mon-Mon 06:00-10:00[Europe/Paris] + actions: + comment: + message: | + This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏 + + - name: backport patches to 8.16 branch + conditions: + - merged + - base=main + - label=backport-8.16 + actions: + backport: + assignees: + - "{{ author }}" + branches: + - "8.16" + labels: + - "backport" + title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})" + + - name: backport patches to 8.17 branch + conditions: + - merged + - base=main + - label=backport-8.17 + actions: + backport: + assignees: + - "{{ author }}" + branches: + - "8.17" + labels: + - "backport" + title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})" + + - name: backport patches to 8.18 branch + conditions: + - merged + - base=main + - label=backport-8.18 + actions: + backport: + assignees: + - "{{ author }}" + branches: + - "8.18" + labels: + - "backport" + title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})" + + - name: backport patches to 8.19 branch + conditions: + - merged + - base=main + - label=backport-8.19 + actions: + backport: + branches: + - "8.19" + + - name: backport patches to 9.0 branch + conditions: + - merged + - base=main + - label=backport-9.0 + actions: + backport: + assignees: + - "{{ author }}" + branches: + - "9.0" + labels: + - "backport" + title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..56f1047be --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-merge-conflict + args: ['--assume-in-merge'] diff --git a/.ruby-version b/.ruby-version index 57fc792f8..489dd416b 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -jruby-9.3.10.0 +jruby-9.4.9.0 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a85449ba5..000000000 --- a/Dockerfile +++ /dev/null @@ -1,64 +0,0 @@ -FROM ubuntu:bionic - -RUN apt-get update && \ - apt-get install -y zlib1g-dev build-essential vim rake git curl libssl-dev libreadline-dev libyaml-dev \ - libxml2-dev libxslt-dev openjdk-11-jdk-headless curl iputils-ping netcat && \ - apt-get clean - -WORKDIR /root - -RUN adduser --disabled-password --gecos "" --home /home/logstash logstash && \ - mkdir -p /usr/local/share/ruby-build && \ - mkdir -p /opt/logstash && \ - mkdir -p /opt/logstash/data && \ - mkdir -p /mnt/host && \ - chown logstash:logstash /opt/logstash - -USER logstash -WORKDIR /home/logstash - -# used by the purge policy -LABEL retention="keep" - -# Setup gradle wrapper. When running any `gradle` command, a `settings.gradle` is expected (and will soon be required). -# This section adds the gradle wrapper, `settings.gradle` and sets the permissions (setting the user to root for `chown` -# and working directory to allow this and then reverts back to the previous working directory and user. -COPY --chown=logstash:logstash gradlew /opt/logstash/gradlew -COPY --chown=logstash:logstash gradle/wrapper /opt/logstash/gradle/wrapper -COPY --chown=logstash:logstash settings.gradle /opt/logstash/settings.gradle -WORKDIR /opt/logstash -RUN for iter in `seq 1 10`; do ./gradlew wrapper --warning-mode all && exit_code=0 && break || exit_code=$? && echo "gradlew error: retry $iter in 10s" && sleep 10; done; exit $exit_code -WORKDIR /home/logstash - -COPY versions.yml /opt/logstash/versions.yml -COPY LICENSE.txt /opt/logstash/LICENSE.txt -COPY NOTICE.TXT /opt/logstash/NOTICE.TXT -COPY licenses /opt/logstash/licenses -COPY CONTRIBUTORS /opt/logstash/CONTRIBUTORS -COPY Gemfile.template Gemfile.jruby-3.1.lock.* /opt/logstash/ -COPY Rakefile /opt/logstash/Rakefile -COPY build.gradle /opt/logstash/build.gradle -COPY rubyUtils.gradle /opt/logstash/rubyUtils.gradle -COPY rakelib /opt/logstash/rakelib -COPY config /opt/logstash/config -COPY spec /opt/logstash/spec -COPY qa /opt/logstash/qa -COPY lib /opt/logstash/lib -COPY pkg /opt/logstash/pkg -COPY buildSrc /opt/logstash/buildSrc -COPY tools /opt/logstash/tools -COPY logstash-core /opt/logstash/logstash-core -COPY logstash-core-plugin-api /opt/logstash/logstash-core-plugin-api -COPY bin /opt/logstash/bin -COPY modules /opt/logstash/modules -COPY x-pack /opt/logstash/x-pack -COPY ci /opt/logstash/ci - -USER root -RUN rm -rf build && \ - mkdir -p build && \ - chown -R logstash:logstash /opt/logstash -USER logstash -WORKDIR /opt/logstash - -LABEL retention="prune" \ No newline at end of file diff --git a/Dockerfile.base b/Dockerfile.base deleted file mode 100644 index a9c189500..000000000 --- a/Dockerfile.base +++ /dev/null @@ -1,22 +0,0 @@ -#logstash-base image, use ci/docker_update_base_image.sh to push updates -FROM ubuntu:bionic - -RUN apt-get update && \ - apt-get install -y zlib1g-dev build-essential vim rake git curl libssl-dev libreadline-dev libyaml-dev \ - libxml2-dev libxslt-dev openjdk-11-jdk-headless curl iputils-ping netcat && \ - apt-get clean - -WORKDIR /root - -RUN adduser --disabled-password --gecos "" --home /home/logstash logstash && \ - mkdir -p /usr/local/share/ruby-build && \ - mkdir -p /opt/logstash && \ - mkdir -p /mnt/host && \ - chown logstash:logstash /opt/logstash - -USER logstash -WORKDIR /home/logstash -RUN mkdir -p /opt/logstash/data - -# used by the purge policy -LABEL retention="keep" diff --git a/Gemfile.template b/Gemfile.template index 49471791c..ba6e429df 100644 --- a/Gemfile.template +++ b/Gemfile.template @@ -9,19 +9,25 @@ gem "paquet", "~> 0.2" gem "pleaserun", "~>0.0.28", require: false gem "rake", "~> 13", require: false gem "ruby-progressbar", "~> 1", require: false -gem "ruby-maven-libs", "~> 3", ">= 3.8.9" +gem "ruby-maven-libs", "~> 3", ">= 3.9.6.1" gem "logstash-output-elasticsearch", ">= 11.14.0" gem "polyglot", require: false gem "treetop", require: false -gem "faraday", "~> 1", :require => false # due elasticsearch-transport (elastic-transport) depending faraday '~> 1' +gem "minitar", "~> 1", :group => :build gem "childprocess", "~> 4", :group => :build gem "fpm", "~> 1", ">= 1.14.1", :group => :build # compound due to bugfix https://github.com/jordansissel/fpm/pull/1856 gem "gems", "~> 1", :group => :build gem "octokit", "~> 4.25", :group => :build gem "rubyzip", "~> 1", :group => :build gem "stud", "~> 0.0.22", :group => :build +# remove fileutils declaration when start using Ruby 3.2+, by default includes `fileutils-v1.7.0` +# (https://git.ruby-lang.org/ruby.git/commit/?h=ruby_3_2&id=05caafb4731c796890027cafedaac59dc108a23a) +# note that the reason to use 1.7.0 is due to https://github.com/logstash-plugins/logstash-integration-aws/issues/28 +gem "fileutils", "~> 1.7" gem "rubocop", :group => :development +# rubocop-ast 1.43.0 carries a dep on `prism` which requires native c extensions +gem 'rubocop-ast', '= 1.42.0', :group => :development gem "belzebuth", :group => :development gem "benchmark-ips", :group => :development gem "ci_reporter_rspec", "~> 1", :group => :development @@ -35,5 +41,9 @@ gem "simplecov", "~> 0.22.0", :group => :development gem "simplecov-json", require: false, :group => :development gem "jar-dependencies", "= 0.4.1" # Gem::LoadError with jar-dependencies 0.4.2 gem "murmurhash3", "= 0.1.6" # Pins until version 0.1.7-java is released +gem "date", "= 3.3.3" gem "thwait" gem "bigdecimal", "~> 3.1" +gem "psych", "5.2.2" +gem "cgi", "0.3.7" # Pins until a new jruby version with updated cgi is released +gem "uri", "0.12.3" # Pins until a new jruby version with updated cgi is released diff --git a/NOTICE.TXT b/NOTICE.TXT index 9ada823fb..fda51f916 100644 --- a/NOTICE.TXT +++ b/NOTICE.TXT @@ -1,6 +1,6 @@ ========== -Notice for: Red Hat Universal Base Image minimal-8 +Notice for: Red Hat Universal Base Image minimal-9 ---------- source: https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf @@ -90,7 +90,7 @@ Copyright © 2019 Red Hat, Inc. All rights reserved. “Red Hat,” is a registe All other trademarks are the property of their respective owners. ========== -Notice for: addressable-2.8.6 +Notice for: addressable-2.8.7 ---------- Copyright © Bob Aman @@ -298,7 +298,7 @@ See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: amazing_print-1.5.0 +Notice for: amazing_print-1.7.2 ---------- MIT License @@ -515,7 +515,7 @@ The Apache Software Foundation (https://www.apache.org/). ========== -Notice for: aws-eventstream-1.3.0 +Notice for: aws-eventstream-1.3.1 ---------- @@ -722,7 +722,7 @@ Notice for: aws-eventstream-1.3.0 limitations under the License. ========== -Notice for: aws-partitions-1.883.0 +Notice for: aws-partitions-1.1055.0 ---------- @@ -929,7 +929,7 @@ Notice for: aws-partitions-1.883.0 limitations under the License. ========== -Notice for: aws-sdk-cloudfront-1.87.0 +Notice for: aws-sdk-cloudfront-1.112.0 ---------- @@ -1136,7 +1136,7 @@ Notice for: aws-sdk-cloudfront-1.87.0 limitations under the License. ========== -Notice for: aws-sdk-cloudwatch-1.85.0 +Notice for: aws-sdk-cloudwatch-1.111.0 ---------- @@ -1343,7 +1343,7 @@ Notice for: aws-sdk-cloudwatch-1.85.0 limitations under the License. ========== -Notice for: aws-sdk-core-3.191.0 +Notice for: aws-sdk-core-3.219.0 ---------- @@ -1550,7 +1550,7 @@ Notice for: aws-sdk-core-3.191.0 limitations under the License. ========== -Notice for: aws-sdk-kms-1.77.0 +Notice for: aws-sdk-kms-1.99.0 ---------- @@ -1757,7 +1757,7 @@ Notice for: aws-sdk-kms-1.77.0 limitations under the License. ========== -Notice for: aws-sdk-resourcegroups-1.58.0 +Notice for: aws-sdk-resourcegroups-1.79.0 ---------- @@ -1964,7 +1964,7 @@ Notice for: aws-sdk-resourcegroups-1.58.0 limitations under the License. ========== -Notice for: aws-sdk-s3-1.143.0 +Notice for: aws-sdk-s3-1.182.0 ---------- @@ -2171,7 +2171,7 @@ Notice for: aws-sdk-s3-1.143.0 limitations under the License. ========== -Notice for: aws-sdk-sns-1.71.0 +Notice for: aws-sdk-sns-1.96.0 ---------- @@ -2378,7 +2378,7 @@ Notice for: aws-sdk-sns-1.71.0 limitations under the License. ========== -Notice for: aws-sdk-sqs-1.70.0 +Notice for: aws-sdk-sqs-1.93.0 ---------- @@ -2585,7 +2585,7 @@ Notice for: aws-sdk-sqs-1.70.0 limitations under the License. ========== -Notice for: aws-sigv4-1.8.0 +Notice for: aws-sigv4-1.11.0 ---------- @@ -2837,7 +2837,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: bigdecimal-3.1.6 +Notice for: bigdecimal-3.1.9 ---------- # source: https://github.com/ruby/bigdecimal/blob/v3.1.4/LICENSE @@ -2899,7 +2899,7 @@ You can redistribute it and/or modify it under either the terms of the WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ========== -Notice for: bindata-2.4.15 +Notice for: bindata-2.5.0 ---------- Copyright (C) 2007-2012 Dion Mendel. All rights reserved. @@ -3035,7 +3035,7 @@ limitations under the License. ========== -Notice for: clamp-1.0.1 +Notice for: clamp-1.3.2 ---------- Copyright (c) 2010 Mike Williams @@ -3086,7 +3086,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: com.fasterxml.jackson.core:jackson-annotations-2.15.2 +Notice for: com.fasterxml.jackson.core:jackson-annotations-2.15.4 ---------- This copy of Jackson JSON processor annotations is licensed under the @@ -3303,7 +3303,7 @@ http://www.apache.org/licenses/LICENSE-2.0 limitations under the License. ========== -Notice for: com.fasterxml.jackson.core:jackson-core-2.15.2 +Notice for: com.fasterxml.jackson.core:jackson-core-2.15.4 ---------- # Jackson JSON processor @@ -3530,7 +3530,7 @@ from the source code management (SCM) system project uses. See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: com.fasterxml.jackson.core:jackson-databind-2.15.2 +Notice for: com.fasterxml.jackson.core:jackson-databind-2.15.4 ---------- # Jackson JSON processor @@ -3766,7 +3766,7 @@ http://www.apache.org/licenses/LICENSE-2.0 See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor-2.15.3 +Notice for: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor-2.16.2 ---------- This copy of Jackson JSON processor databind module is licensed under the @@ -3981,7 +3981,7 @@ http://www.apache.org/licenses/LICENSE-2.0 See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: com.fasterxml.jackson.module:jackson-module-afterburner-2.15.2 +Notice for: com.fasterxml.jackson.module:jackson-module-afterburner-2.15.4 ---------- This copy of Jackson JSON processor databind module is licensed under the @@ -4196,7 +4196,7 @@ http://www.apache.org/licenses/LICENSE-2.0 See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: com.google.googlejavaformat:google-java-format-1.15.0 +Notice for: com.google.googlejavaformat:google-java-format-1.22.0 ---------- Copyright 2015 Google Inc. @@ -4472,7 +4472,7 @@ Program Directory ========== -Notice for: com.google.guava:guava-32.1.2-jre +Notice for: com.google.guava:guava-33.1.0-jre ---------- @@ -4678,7 +4678,7 @@ Notice for: com.google.guava:guava-32.1.2-jre See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: commons-codec:commons-codec-1.15 +Notice for: commons-codec:commons-codec-1.17.0 ---------- Apache Commons Codec @@ -5140,7 +5140,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: dalli-3.2.7 +Notice for: dalli-3.2.8 ---------- Copyright (c) Peter M. Goldstein, Mike Perham @@ -5165,7 +5165,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: date-3.3.4 +Notice for: date-3.3.3 ---------- Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. @@ -5191,6 +5191,51 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== +Notice for: diff-lcs-1.6.0 +---------- + +source: https://github.com/halostatue/diff-lcs/blob/v1.5.0/License.md + +== License + +This software is available under three licenses: the GNU GPL version 2 (or at +your option, a later version), the Perl Artistic license, or the MIT license. +Note that my preference for licensing is the MIT license, but Algorithm::Diff +was dually originally licensed with the Perl Artistic and the GNU GPL ("the +same terms as Perl itself") and given that the Ruby implementation originally +hewed pretty closely to the Perl version, I must maintain the additional +licensing terms. + +* Copyright 2004–2013 Austin Ziegler. +* Adapted from Algorithm::Diff (Perl) by Ned Konz and a Smalltalk version by + Mario I. Wolczko. + +=== MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +=== Perl Artistic License (version 2) +See the file docs/artistic.txt in the main distribution. + +=== GNU GPL version 2 +See the file docs/COPYING.txt in the main distribution. +========== Notice for: domain_name-0.6.20240107 ---------- @@ -5274,7 +5319,7 @@ This file is generated from the Public Suffix List https://mozilla.org/MPL/2.0/ ========== -Notice for: dotenv-2.8.1 +Notice for: dotenv-3.1.7 ---------- Copyright (c) 2012 Brandon Keepers @@ -5381,423 +5426,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: elastic-enterprise-search-8.9.0 ----------- - -source: https://github.com/elastic/enterprise-search-ruby/blob/v7.16.0/LICENSE - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. -========== -Notice for: elastic-transport-8.3.1 ----------- - -source: https://github.com/elastic/elastic-transport-ruby/blob/v8.3.0/LICENSE - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. -========== -Notice for: elasticsearch-7.17.10 +Notice for: elasticsearch-7.17.11 ---------- source: https://github.com/elastic/elasticsearch-ruby/blob/v5.0.4/elasticsearch-api/LICENSE.txt @@ -5817,7 +5446,7 @@ See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: elasticsearch-api-7.17.10 +Notice for: elasticsearch-api-7.17.11 ---------- source: https://github.com/elastic/elasticsearch-ruby/blob/v5.0.4/elasticsearch-transport/LICENSE.txt @@ -5837,7 +5466,7 @@ See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: elasticsearch-transport-7.17.10 +Notice for: elasticsearch-transport-7.17.11 ---------- source: https://github.com/elastic/elasticsearch-ruby/blob/v5.0.4/elasticsearch/LICENSE.txt @@ -5885,35 +5514,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: et-orbi-1.2.7 ----------- - -source: https://github.com/floraison/et-orbi/blob/v1.2.7/LICENSE.txt - -Copyright (c) 2017-2022, John Mettraux, jmettraux+flor@gmail.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -Made in Japan -========== -Notice for: faraday-1.10.3 +Notice for: faraday-1.10.4 ---------- source: https://github.com/lostisland/faraday/blob/v0.9.2/LICENSE.md @@ -5998,7 +5599,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ========== -Notice for: faraday-multipart-1.0.4 +Notice for: faraday-multipart-1.1.0 ---------- source: https://github.com/lostisland/faraday-multipart/blob/v1.0.3/LICENSE.md @@ -6016,7 +5617,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ========== -Notice for: faraday-net_http-1.0.1 +Notice for: faraday-net_http-1.0.2 ---------- source: https://github.com/lostisland/faraday-net_http/blob/v1.0.0/LICENSE.md @@ -6100,7 +5701,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ========== -Notice for: ffi-1.16.3 +Notice for: ffi-1.17.1 ---------- source: https://github.com/ffi/ffi/blob/1.9.23/LICENSE @@ -6157,33 +5758,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: fugit-1.9.0 +Notice for: fileutils-1.7.3 ---------- -source: https://github.com/floraison/fugit/blob/v1.5.2/LICENSE.txt +Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. -Copyright (c) 2017-2021, John Mettraux, jmettraux+flor@gmail.com +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -Made in Japan +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. ========== Notice for: gelfd2-0.4.1 ---------- @@ -6203,7 +5802,7 @@ See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: gems-1.2.0 +Notice for: gems-1.3.0 ---------- source: https://github.com/rubygems/gems/blob/v0.8.3/LICENSE.md @@ -6292,7 +5891,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: http-cookie-1.0.5 +Notice for: http-cookie-1.0.8 ---------- source: https://github.com/sparklemotion/http-cookie/blob/v1.0.3/LICENSE.txt @@ -6380,7 +5979,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: i18n-1.14.1 +Notice for: i18n-1.14.7 ---------- source: https://github.com/svenfuchs/i18n/blob/v0.6.9/MIT-LICENSE @@ -6865,7 +6464,7 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION of your accepting any such warranty or additional liability. ========== -Notice for: jrjackson-0.4.18 +Notice for: jrjackson-0.4.20 ---------- https://github.com/guyboertje/jrjackson/blob/v0.4.6/README.md @@ -9357,7 +8956,7 @@ See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: jruby-openssl-0.14.2 +Notice for: jruby-openssl-0.15.3 ---------- source: https://github.com/jruby/jruby-openssl/blob/v0.9.21/LICENSE.txt @@ -9417,7 +9016,7 @@ 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. ========== -Notice for: json-2.7.1 +Notice for: json-2.10.1 ---------- source: https://github.com/tmattia/json-generator/blob/v0.1.0/LICENSE.txt @@ -9445,18 +9044,31 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: jwt-2.7.1 +Notice for: logger-1.6.6 ---------- -source: https://github.com/jwt/ruby-jwt/blob/v2.2.2/LICENSE +Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. -Copyright (c) 2011 Jeff Lindsay +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. ========== Notice for: lru_redux-1.1.0 ---------- @@ -9594,7 +9206,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: method_source-1.0.0 +Notice for: method_source-1.1.0 ---------- source: https://github.com/banister/method_source/blob/v0.9.0/README.markdown#license @@ -9673,7 +9285,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: minitar-0.9 +Notice for: minitar-1.0.2 ---------- source: https://github.com/halostatue/minitar/blob/v0.6.1/Licence.md @@ -9685,7 +9297,7 @@ terms of Ruby’s licence or the Simplified BSD licence. * Portions copyright 2004 Mauricio Julio Fernández Pradier. ========== -Notice for: msgpack-1.7.2 +Notice for: msgpack-1.8.0 ---------- source: https://github.com/msgpack/msgpack-ruby/blob/v1.2.4/ext/msgpack/ @@ -9730,7 +9342,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: multipart-post-2.3.0 +Notice for: multipart-post-2.4.1 ---------- source: https://github.com/nicksieger/multipart-post/blob/v2.0.0/README.md#license @@ -9813,7 +9425,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: mustermann-2.0.2 +Notice for: mustermann-3.0.3 ---------- Copyright (c) 2013-2017 Konstantin Haase @@ -9870,7 +9482,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: net-imap-0.4.9.1 +Notice for: net-imap-0.5.6 ---------- # source: https://github.com/ruby/net-imap/blob/v0.3.7/LICENSE.txt @@ -10014,7 +9626,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: net-smtp-0.4.0.1 +Notice for: net-smtp-0.5.1 ---------- # source: https://github.com/ruby/net-smtp/blob/v0.4.0/LICENSE.txt @@ -10042,7 +9654,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: nio4r-2.7.0 +Notice for: nio4r-2.7.4 ---------- Released under the MIT license. @@ -10057,7 +9669,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: nokogiri-1.16.0 +Notice for: nokogiri-1.18.3 ---------- source: https://github.com/sparklemotion/nokogiri/blob/v1.8.2/LICENSE.md @@ -10120,7 +9732,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: org.apache.httpcomponents:httpclient-4.5.13 +Notice for: org.apache.httpcomponents:httpclient-4.5.14 ---------- source: https://github.com/apache/httpcomponents-client/blob/4.5.x/NOTICE.txt @@ -10132,7 +9744,7 @@ This product includes software developed at The Apache Software Foundation (http://www.apache.org/). ========== -Notice for: org.apache.httpcomponents:httpcore-4.4.14 +Notice for: org.apache.httpcomponents:httpcore-4.4.16 ---------- source: https://github.com/apache/httpcomponents-core/blob/4.4.x/NOTICE.txt @@ -10144,7 +9756,7 @@ This product includes software developed at The Apache Software Foundation (http://www.apache.org/). ========== -Notice for: org.apache.logging.log4j:log4j-1.2-api-2.17.1 +Notice for: org.apache.logging.log4j:log4j-1.2-api-2.17.2 ---------- source: https://github.com/apache/logging-log4j2/blob/rel/2.14.0/NOTICE.txt @@ -10167,7 +9779,7 @@ Copyright 2002-2012 Ramnivas Laddad, Juergen Hoeller, Chris Beams picocli (http://picocli.info) Copyright 2017 Remko Popma ========== -Notice for: org.apache.logging.log4j:log4j-api-2.17.1 +Notice for: org.apache.logging.log4j:log4j-api-2.17.2 ---------- source: https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob;f=NOTICE.txt;h=bd95322f254fc6f691b47e77df8c21229f47b8d4;hb=HEAD @@ -10190,7 +9802,7 @@ Copyright 2002-2012 Ramnivas Laddad, Juergen Hoeller, Chris Beams picocli (http://picocli.info) Copyright 2017 Remko Popma ========== -Notice for: org.apache.logging.log4j:log4j-core-2.17.1 +Notice for: org.apache.logging.log4j:log4j-core-2.17.2 ---------- source: https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob;f=NOTICE.txt;h=bd95322f254fc6f691b47e77df8c21229f47b8d4;hb=HEAD @@ -10213,7 +9825,7 @@ Copyright 2002-2012 Ramnivas Laddad, Juergen Hoeller, Chris Beams picocli (http://picocli.info) Copyright 2017 Remko Popma ========== -Notice for: org.apache.logging.log4j:log4j-jcl-2.17.1 +Notice for: org.apache.logging.log4j:log4j-jcl-2.17.2 ---------- source: https://github.com/apache/logging-log4j2/blob/rel/2.14.0/NOTICE.txt @@ -10236,7 +9848,7 @@ Copyright 2002-2012 Ramnivas Laddad, Juergen Hoeller, Chris Beams picocli (http://picocli.info) Copyright 2017 Remko Popma ========== -Notice for: org.apache.logging.log4j:log4j-slf4j-impl-2.17.1 +Notice for: org.apache.logging.log4j:log4j-slf4j-impl-2.17.2 ---------- source: https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob;f=NOTICE.txt;h=bd95322f254fc6f691b47e77df8c21229f47b8d4;hb=HEAD @@ -10295,7 +9907,7 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: org.javassist:javassist-3.29.0-GA +Notice for: org.javassist:javassist-3.30.2-GA ---------- Copyright (C) 1999-2019 by Shigeru Chiba, All rights reserved. @@ -10303,7 +9915,7 @@ Copyright (C) 1999-2019 by Shigeru Chiba, All rights reserved. This software is distributed under the Mozilla Public License Version 1.1, the GNU Lesser General Public License Version 2.1 or later, or the Apache License Version 2.0. ========== -Notice for: org.jruby:jruby-core-9.4.5.0 +Notice for: org.jruby:jruby-core-9.4.9.0 ---------- JRuby is Copyright (c) 2007-2018 The JRuby project @@ -10586,7 +10198,7 @@ Eclipse Public License - v 2.0 You may add additional accurate notices of copyright ownership. ========== -Notice for: org.logstash:jvm-options-parser-8.13.0 +Notice for: org.logstash:jvm-options-parser-9.1.0 ---------- Copyright (c) 2022 Elasticsearch B.V. @@ -10723,7 +10335,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: pry-0.14.2 +Notice for: pry-0.15.2 ---------- Copyright (c) 2016 John Mair (banisterfiend) @@ -10748,7 +10360,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: psych-5.1.2 +Notice for: psych-5.2.2 ---------- MIT License @@ -10774,7 +10386,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: public_suffix-5.0.4 +Notice for: public_suffix-5.1.1 ---------- Copyright (c) 2009-2018 Simone Carletti @@ -10801,7 +10413,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: puma-6.4.2 +Notice for: puma-6.6.0 ---------- Some code copyright (c) 2005, Zed Shaw @@ -10832,35 +10444,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: raabro-1.4.0 ----------- - -source: https://github.com/floraison/raabro/blob/v1.4.0/LICENSE.txt - -Copyright (c) 2015-2020, John Mettraux, jmettraux@gmail.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -Made in Japan. -========== -Notice for: racc-1.7.3 +Notice for: racc-1.8.1 ---------- source: https://github.com/ruby/racc/blob/master/COPYING @@ -10889,7 +10473,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: rack-2.2.8 +Notice for: rack-3.1.10 ---------- The MIT License (MIT) @@ -10913,7 +10497,7 @@ THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: rack-protection-2.2.4 +Notice for: rack-protection-4.1.1 ---------- The MIT License (MIT) @@ -10940,7 +10524,83 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: rake-13.1.0 +Notice for: rack-session-2.1.0 +---------- + +# MIT License + +Copyright, 2007-2008, by Leah Neukirchen. +Copyright, 2007-2009, by Scytrin dai Kinthra. +Copyright, 2008, by Daniel Roethlisberger. +Copyright, 2009, by Joshua Peek. +Copyright, 2009, by Mickaël Riga. +Copyright, 2010, by Simon Chiang. +Copyright, 2010-2011, by José Valim. +Copyright, 2010-2013, by James Tucker. +Copyright, 2010-2019, by Aaron Patterson. +Copyright, 2011, by Max Cantor. +Copyright, 2011-2012, by Konstantin Haase. +Copyright, 2011, by Will Leinweber. +Copyright, 2011, by John Manoogian III. +Copyright, 2012, by Yun Huang Yong. +Copyright, 2012, by Ravil Bayramgalin. +Copyright, 2012, by Timothy Elliott. +Copyright, 2012, by Jamie Macey. +Copyright, 2012-2015, by Santiago Pastorino. +Copyright, 2013, by Andrew Cole. +Copyright, 2013, by Postmodern. +Copyright, 2013, by Vipul A M. +Copyright, 2013, by Charles Hornberger. +Copyright, 2014, by Michal Bryxí. +Copyright, 2015, by deepj. +Copyright, 2015, by Doug McInnes. +Copyright, 2015, by David Runger. +Copyright, 2015, by Francesco Rodríguez. +Copyright, 2015, by Yuichiro Kaneko. +Copyright, 2015, by Michael Sauter. +Copyright, 2016, by Kir Shatrov. +Copyright, 2016, by Yann Vanhalewyn. +Copyright, 2016, by Jian Weihang. +Copyright, 2017, by Jordan Raine. +Copyright, 2018, by Dillon Welch. +Copyright, 2018, by Yoshiyuki Hirano. +Copyright, 2019, by Krzysztof Rybka. +Copyright, 2019, by Frederick Cheung. +Copyright, 2019, by Adrian Setyadi. +Copyright, 2019, by Rafael Mendonça França. +Copyright, 2019-2020, by Pavel Rosicky. +Copyright, 2019, by Dima Fatko. +Copyright, 2019, by Oleh Demianiuk. +Copyright, 2020-2023, by Samuel Williams. +Copyright, 2020-2022, by Jeremy Evans. +Copyright, 2020, by Alex Speller. +Copyright, 2020, by Ryuta Kamizono. +Copyright, 2020, by Yudai Suzuki. +Copyright, 2020, by Bart de Water. +Copyright, 2020, by Alec Clarke. +Copyright, 2021, by Michael Coyne. +Copyright, 2022, by Philip Arndt. +Copyright, 2022, by Jon Dufresne. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +========== +Notice for: rake-13.2.1 ---------- Copyright (c) Jim Weirich @@ -10990,7 +10650,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: rexml-3.2.6 +Notice for: rexml-3.4.1 ---------- source: https://github.com/ruby/rexml/blob/v3.2.5/LICENSE.txt @@ -11017,6 +10677,299 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========== +Notice for: rspec-3.13.0 +---------- + +source: https://github.com/rspec/rspec-metagem/blob/v3.12.0/LICENSE.md + +The MIT License (MIT) +===================== + +Copyright © 2009 Chad Humphries, David Chelimsky +Copyright © 2006 David Chelimsky, The RSpec Development Team +Copyright © 2005 Steven Baker + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +========== +Notice for: rspec-collection_matchers-1.2.1 +---------- + +source: https://github.com/rspec/rspec-collection_matchers/blob/v1.2.1/LICENSE.txt + +(The MIT License) + +Copyright (c) 2013 Hugo Barauna +Copyright (c) 2012 David Chelimsky, Myron Marston +Copyright (c) 2006 David Chelimsky, The RSpec Development Team +Copyright (c) 2005 Steven Baker + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========== +Notice for: rspec-core-3.13.3 +---------- + +source: https://github.com/rspec/rspec-core/blob/v3.12.2/LICENSE.md + +The MIT License (MIT) +===================== + +* Copyright © 2012 Chad Humphries, David Chelimsky, Myron Marston +* Copyright © 2009 Chad Humphries, David Chelimsky +* Copyright © 2006 David Chelimsky, The RSpec Development Team +* Copyright © 2005 Steven Baker + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========== +Notice for: rspec-expectations-3.13.3 +---------- + +source: https://github.com/rspec/rspec-expectations/blob/v3.12.3/LICENSE.md + +The MIT License (MIT) +===================== + +* Copyright © 2012 David Chelimsky, Myron Marston +* Copyright © 2006 David Chelimsky, The RSpec Development Team +* Copyright © 2005 Steven Baker + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========== +Notice for: rspec-mocks-3.13.2 +---------- + +source: https://github.com/rspec/rspec-mocks/blob/v3.12.6/LICENSE.md + +The MIT License (MIT) +===================== + +* Copyright © 2012 David Chelimsky, Myron Marston +* Copyright © 2006 David Chelimsky, The RSpec Development Team +* Copyright © 2005 Steven Baker + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========== +Notice for: rspec-support-3.13.2 +---------- + +source: https://github.com/rspec/rspec-support/blob/v3.12.1/LICENSE.md + +The MIT License (MIT) +==================== + +* Copyright © 2013 David Chelimsky, Myron Marston, Jon Rowe, Sam Phippen, Xavier Shay, Bradley Schaefer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========== +Notice for: rspec-wait-1.0.1 +---------- + +source: https://github.com/laserlemon/rspec-wait/blob/v0.0.9/LICENSE.txt + +Copyright (c) 2014 Steve Richert + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========== +Notice for: ruby-maven-libs-3.9.9 +---------- + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and +(b) You must cause any modified files to carry prominent notices stating that You changed the files; and +(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed 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. + +Standard License Header +Copyright [yyyy] [name of copyright owner] + +Licensed 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. + ========== Notice for: ruby-progressbar-1.13.0 ---------- @@ -11141,7 +11094,7 @@ You can redistribute it and/or modify it under either the terms of the PURPOSE. ========== -Notice for: rufus-scheduler-3.9.1 +Notice for: rufus-scheduler-3.0.9 ---------- @@ -11185,7 +11138,7 @@ See the License for the specific language governing permissions and limitations under the License. ========== -Notice for: sequel-5.76.0 +Notice for: sequel-5.89.0 ---------- Copyright (c) 2007-2008 Sharon Rosner @@ -11234,7 +11187,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: sinatra-2.2.4 +Notice for: sinatra-4.1.1 ---------- Copyright (c) 2007, 2008, 2009 Blake Mizerany @@ -11262,28 +11215,51 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: snmp-1.3.2 +Notice for: snappy-0.4.0 ---------- -Copyright (c) 2004-2014 David R. Halliday +Copyright (c) 2011-2013 miyucy -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +MIT License -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +========== +Notice for: snappy-jars-1.1.0.1.2 +---------- + +Copyright Doug Mayer (https://github.com/doxavore) + +README.md: "Per the real implementation, Apache License v2.0." + +Licensed 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. ========== Notice for: spoon-0.0.6 @@ -11630,7 +11606,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: tilt-2.3.0 +Notice for: tilt-2.6.0 ---------- Copyright (c) 2010-2016 Ryan Tomayko @@ -11653,7 +11629,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: timeout-0.4.1 +Notice for: timeout-0.4.3 ---------- Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. @@ -11679,7 +11655,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========== -Notice for: treetop-1.6.12 +Notice for: treetop-1.6.14 ---------- Copyright (c) 2007 Nathan Sobo. @@ -11752,7 +11728,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: tzinfo-data-1.2023.4 +Notice for: tzinfo-data-1.2025.1 ---------- Copyright (c) 2005-2018 Philip Ross @@ -11776,7 +11752,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========== -Notice for: webhdfs-0.10.2 +Notice for: webhdfs-0.11.0 ---------- Copyright (C) 2012 Fluentd Project @@ -11793,6 +11769,34 @@ Copyright (C) 2012 Fluentd Project See the License for the specific language governing permissions and limitations under the License. +========== +Notice for: webrick-1.9.1 +---------- + +source: https://github.com/ruby/webrick/blob/v1.8.1/LICENSE.txt + +Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. ========== Notice for: xml-simple-1.1.9 ---------- diff --git a/README.md b/README.md index edb4a68d7..9daea3a65 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ supported platforms, from [downloads page](https://www.elastic.co/downloads/logs - [Logstash Forum](https://discuss.elastic.co/c/logstash) - [Logstash Documentation](https://www.elastic.co/guide/en/logstash/current/index.html) -- [#logstash on freenode IRC](https://webchat.freenode.net/?channels=logstash) - [Logstash Product Information](https://www.elastic.co/products/logstash) - [Elastic Support](https://www.elastic.co/subscriptions) diff --git a/bin/ingest-convert.bat b/bin/ingest-convert.bat deleted file mode 100644 index e9067f428..000000000 --- a/bin/ingest-convert.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -cd /d "%~dp0\.." -for /f %%i in ('cd') do set RESULT=%%i - -"%JAVACMD%" -cp "!RESULT!\tools\ingest-converter\build\libs\ingest-converter.jar;*" ^ - org.logstash.ingest.Pipeline %* - -endlocal diff --git a/bin/ingest-convert.sh b/bin/ingest-convert.sh deleted file mode 100755 index 1205cebc5..000000000 --- a/bin/ingest-convert.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -java -cp "$(cd `dirname $0`/..; pwd)"'/tools/ingest-converter/build/libs/ingest-converter.jar:*' \ - org.logstash.ingest.Pipeline "$@" diff --git a/bin/logstash.bat b/bin/logstash.bat index 44fff6f60..7015e8568 100644 --- a/bin/logstash.bat +++ b/bin/logstash.bat @@ -6,7 +6,7 @@ set params='%*' if "%1" == "-V" goto version if "%1" == "--version" goto version -call "%~dp0setup.bat" || exit /b 1 +1>&2 (call "%~dp0setup.bat") || exit /b 1 if errorlevel 1 ( if not defined nopauseonerror ( pause diff --git a/bin/logstash.lib.sh b/bin/logstash.lib.sh index 3c4da9070..388e9650d 100755 --- a/bin/logstash.lib.sh +++ b/bin/logstash.lib.sh @@ -186,8 +186,8 @@ setup_vendored_jruby() { } setup() { - setup_java - setup_vendored_jruby + >&2 setup_java + >&2 setup_vendored_jruby } ruby_exec() { diff --git a/bin/pqcheck.bat b/bin/pqcheck.bat index 1ada6ff4b..deed8b173 100644 --- a/bin/pqcheck.bat +++ b/bin/pqcheck.bat @@ -16,7 +16,7 @@ for %%i in ("%LS_HOME%\logstash-core\lib\jars\*.jar") do ( call :concat "%%i" ) -"%JAVACMD%" %JAVA_OPTS% -cp "%CLASSPATH%" org.logstash.ackedqueue.PqCheck %* +"%JAVACMD%" %JAVA_OPTS% org.logstash.ackedqueue.PqCheck %* :concat IF not defined CLASSPATH ( diff --git a/bin/pqrepair.bat b/bin/pqrepair.bat index fee6f778c..59a6201c0 100644 --- a/bin/pqrepair.bat +++ b/bin/pqrepair.bat @@ -16,7 +16,7 @@ for %%i in ("%LS_HOME%\logstash-core\lib\jars\*.jar") do ( call :concat "%%i" ) -"%JAVACMD%" %JAVA_OPTS% -cp "%CLASSPATH%" org.logstash.ackedqueue.PqRepair %* +"%JAVACMD%" %JAVA_OPTS% org.logstash.ackedqueue.PqRepair %* :concat IF not defined CLASSPATH ( diff --git a/bin/setup.bat b/bin/setup.bat index 8a7dd4310..18b19e699 100644 --- a/bin/setup.bat +++ b/bin/setup.bat @@ -42,7 +42,7 @@ if defined LS_JAVA_HOME ( ) if not exist "%JAVACMD%" ( - echo could not find java; set JAVA_HOME or ensure java is in PATH 1>&2 + echo could not find java; set LS_JAVA_HOME or ensure java is in PATH 1>&2 exit /b 1 ) diff --git a/build.gradle b/build.gradle index 6fbe07535..87d139fb4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,8 +19,8 @@ buildscript { ext { - snakeYamlVersion = '2.0' - shadowGradlePluginVersion = '7.0.0' + snakeYamlVersion = '2.2' + shadowGradlePluginVersion = '8.1.1' } repositories { @@ -37,8 +37,6 @@ buildscript { plugins { id "de.undercouch.download" version "4.0.4" id "com.dorongold.task-tree" version "2.1.0" -// id "jacoco" -// id "org.sonarqube" version "4.3.0.3225" } apply plugin: 'de.undercouch.download' @@ -59,8 +57,11 @@ allprojects { apply plugin: 'java' apply plugin: 'idea' apply plugin: 'java-library' - project.sourceCompatibility = JavaVersion.VERSION_11 - project.targetCompatibility = JavaVersion.VERSION_11 + + java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } tasks.withType(JavaCompile).configureEach { options.compilerArgs.add("-Xlint:all") @@ -100,6 +101,7 @@ allprojects { "--add-opens=java.base/java.lang=ALL-UNNAMED", "--add-opens=java.base/java.util=ALL-UNNAMED" ] + maxHeapSize = "2g" //https://stackoverflow.com/questions/3963708/gradle-how-to-display-test-results-in-the-console-in-real-time testLogging { // set options for log level LIFECYCLE @@ -144,7 +146,6 @@ subprojects { } version = versionMap['logstash-core'] -String artifactVersionsApi = "https://artifacts-api.elastic.co/v1/versions" tasks.register("configureArchitecture") { String arch = System.properties['os.arch'] @@ -170,33 +171,28 @@ tasks.register("configureArtifactInfo") { description "Set the url to download stack artifacts for select stack version" doLast { - def versionQualifier = System.getenv('VERSION_QUALIFIER') - if (versionQualifier) { - version = "$version-$versionQualifier" - } + def splitVersion = version.split('\\.') + int major = splitVersion[0].toInteger() + int minor = splitVersion[1].toInteger() + String branch = "${major}.${minor}" + String fallbackMajorX = "${major}.x" + boolean isFallBackPreviousMajor = minor - 1 < 0 + String fallbackBranch = isFallBackPreviousMajor ? "${major-1}.x" : "${major}.${minor-1}" + def qualifiedVersion = "" - boolean isReleaseBuild = System.getenv('RELEASE') == "1" || versionQualifier - String apiResponse = artifactVersionsApi.toURL().text - - def dlVersions = new JsonSlurper().parseText(apiResponse) - String qualifiedVersion = dlVersions['versions'].grep(isReleaseBuild ? ~/^${version}$/ : ~/^${version}-SNAPSHOT/)[0] - if (qualifiedVersion == null) { - if (!isReleaseBuild) { - project.ext.set("useProjectSpecificArtifactSnapshotUrl", true) - project.ext.set("stackArtifactSuffix", "${version}-SNAPSHOT") - return + for (b in [branch, fallbackMajorX, fallbackBranch]) { + def url = "https://storage.googleapis.com/artifacts-api/snapshots/${b}.json" + try { + def snapshotInfo = new JsonSlurper().parseText(url.toURL().text) + qualifiedVersion = snapshotInfo.version + println "ArtifactInfo version: ${qualifiedVersion}" + break + } catch (Exception e) { + println "Failed to fetch branch ${branch} from ${url}: ${e.message}" } - throw new GradleException("could not find the current artifact from the artifact-api ${artifactVersionsApi} for ${version}") } - // find latest reference to last build - String buildsListApi = "${artifactVersionsApi}/${qualifiedVersion}/builds/" - apiResponse = buildsListApi.toURL().text - def dlBuilds = new JsonSlurper().parseText(apiResponse) - def stackBuildVersion = dlBuilds["builds"][0] - project.ext.set("artifactApiVersionedBuildUrl", "${artifactVersionsApi}/${qualifiedVersion}/builds/${stackBuildVersion}") - project.ext.set("stackArtifactSuffix", qualifiedVersion) - project.ext.set("useProjectSpecificArtifactSnapshotUrl", false) + project.ext.set("artifactApiVersion", qualifiedVersion) } } @@ -332,7 +328,6 @@ tasks.register("assembleTarDistribution") { inputs.files fileTree("${projectDir}/bin") inputs.files fileTree("${projectDir}/config") inputs.files fileTree("${projectDir}/lib") - inputs.files fileTree("${projectDir}/modules") inputs.files fileTree("${projectDir}/logstash-core-plugin-api") inputs.files fileTree("${projectDir}/logstash-core/lib") inputs.files fileTree("${projectDir}/logstash-core/src") @@ -349,7 +344,6 @@ tasks.register("assembleOssTarDistribution") { inputs.files fileTree("${projectDir}/bin") inputs.files fileTree("${projectDir}/config") inputs.files fileTree("${projectDir}/lib") - inputs.files fileTree("${projectDir}/modules") inputs.files fileTree("${projectDir}/logstash-core-plugin-api") inputs.files fileTree("${projectDir}/logstash-core/lib") inputs.files fileTree("${projectDir}/logstash-core/src") @@ -364,7 +358,6 @@ tasks.register("assembleZipDistribution") { inputs.files fileTree("${projectDir}/bin") inputs.files fileTree("${projectDir}/config") inputs.files fileTree("${projectDir}/lib") - inputs.files fileTree("${projectDir}/modules") inputs.files fileTree("${projectDir}/logstash-core-plugin-api") inputs.files fileTree("${projectDir}/logstash-core/lib") inputs.files fileTree("${projectDir}/logstash-core/src") @@ -381,7 +374,6 @@ tasks.register("assembleOssZipDistribution") { inputs.files fileTree("${projectDir}/bin") inputs.files fileTree("${projectDir}/config") inputs.files fileTree("${projectDir}/lib") - inputs.files fileTree("${projectDir}/modules") inputs.files fileTree("${projectDir}/logstash-core-plugin-api") inputs.files fileTree("${projectDir}/logstash-core/lib") inputs.files fileTree("${projectDir}/logstash-core/src") @@ -416,7 +408,7 @@ def qaBuildPath = "${buildDir}/qa/integration" def qaVendorPath = "${qaBuildPath}/vendor" tasks.register("installIntegrationTestGems") { - dependsOn unpackTarDistribution + dependsOn assembleTarDistribution def gemfilePath = file("${projectDir}/qa/integration/Gemfile") inputs.files gemfilePath inputs.files file("${projectDir}/qa/integration/integration_tests.gemspec") @@ -439,23 +431,13 @@ tasks.register("downloadFilebeat") { doLast { download { - String beatVersion = project.ext.get("stackArtifactSuffix") - String downloadedFilebeatName = "filebeat-${beatVersion}-${project.ext.get("beatsArchitecture")}" + String beatsVersion = project.ext.get("artifactApiVersion") + String downloadedFilebeatName = "filebeat-${beatsVersion}-${project.ext.get("beatsArchitecture")}" project.ext.set("unpackedFilebeatName", downloadedFilebeatName) - if (project.ext.get("useProjectSpecificArtifactSnapshotUrl")) { - def res = SnapshotArtifactURLs.packageUrls("beats", beatVersion, downloadedFilebeatName) - project.ext.set("filebeatSnapshotUrl", System.getenv("FILEBEAT_SNAPSHOT_URL") ?: res.packageUrl) - project.ext.set("filebeatDownloadLocation", "${projectDir}/build/${downloadedFilebeatName}.tar.gz") - } else { - // find url of build artifact - String artifactApiUrl = "${project.ext.get("artifactApiVersionedBuildUrl")}/projects/beats/packages/${downloadedFilebeatName}.tar.gz" - String apiResponse = artifactApiUrl.toURL().text - def buildUrls = new JsonSlurper().parseText(apiResponse) - - project.ext.set("filebeatSnapshotUrl", System.getenv("FILEBEAT_SNAPSHOT_URL") ?: buildUrls["package"]["url"]) - project.ext.set("filebeatDownloadLocation", "${projectDir}/build/${downloadedFilebeatName}.tar.gz") - } + def res = SnapshotArtifactURLs.packageUrls("beats", beatsVersion, downloadedFilebeatName) + project.ext.set("filebeatSnapshotUrl", System.getenv("FILEBEAT_SNAPSHOT_URL") ?: res.packageUrl) + project.ext.set("filebeatDownloadLocation", "${projectDir}/build/${downloadedFilebeatName}.tar.gz") src project.ext.filebeatSnapshotUrl onlyIfNewer true @@ -491,20 +473,12 @@ tasks.register("checkEsSHA") { description "Download ES version remote's fingerprint file" doLast { - String esVersion = project.ext.get("stackArtifactSuffix") + String esVersion = project.ext.get("artifactApiVersion") String downloadedElasticsearchName = "elasticsearch-${esVersion}-${project.ext.get("esArchitecture")}" String remoteSHA - if (project.ext.get("useProjectSpecificArtifactSnapshotUrl")) { - def res = SnapshotArtifactURLs.packageUrls("elasticsearch", esVersion, downloadedElasticsearchName) - remoteSHA = res.packageShaUrl - } else { - // find url of build artifact - String artifactApiUrl = "${project.ext.get("artifactApiVersionedBuildUrl")}/projects/elasticsearch/packages/${downloadedElasticsearchName}.tar.gz" - String apiResponse = artifactApiUrl.toURL().text - def buildUrls = new JsonSlurper().parseText(apiResponse) - remoteSHA = buildUrls.package.sha_url.toURL().text - } + def res = SnapshotArtifactURLs.packageUrls("elasticsearch", esVersion, downloadedElasticsearchName) + remoteSHA = res.packageShaUrl def localESArchive = new File("${projectDir}/build/${downloadedElasticsearchName}.tar.gz") if (localESArchive.exists()) { @@ -538,25 +512,14 @@ tasks.register("downloadEs") { doLast { download { - String esVersion = project.ext.get("stackArtifactSuffix") + String esVersion = project.ext.get("artifactApiVersion") String downloadedElasticsearchName = "elasticsearch-${esVersion}-${project.ext.get("esArchitecture")}" project.ext.set("unpackedElasticsearchName", "elasticsearch-${esVersion}") - if (project.ext.get("useProjectSpecificArtifactSnapshotUrl")) { - def res = SnapshotArtifactURLs.packageUrls("elasticsearch", esVersion, downloadedElasticsearchName) - project.ext.set("elasticsearchSnapshotURL", System.getenv("ELASTICSEARCH_SNAPSHOT_URL") ?: res.packageUrl) - project.ext.set("elasticsearchDownloadLocation", "${projectDir}/build/${downloadedElasticsearchName}.tar.gz") - } else { - // find url of build artifact - String artifactApiUrl = "${project.ext.get("artifactApiVersionedBuildUrl")}/projects/elasticsearch/packages/${downloadedElasticsearchName}.tar.gz" - String apiResponse = artifactApiUrl.toURL().text - - def buildUrls = new JsonSlurper().parseText(apiResponse) - - project.ext.set("elasticsearchSnapshotURL", System.getenv("ELASTICSEARCH_SNAPSHOT_URL") ?: buildUrls["package"]["url"]) - project.ext.set("elasticsearchDownloadLocation", "${projectDir}/build/${downloadedElasticsearchName}.tar.gz") - } + def res = SnapshotArtifactURLs.packageUrls("elasticsearch", esVersion, downloadedElasticsearchName) + project.ext.set("elasticsearchSnapshotURL", System.getenv("ELASTICSEARCH_SNAPSHOT_URL") ?: res.packageUrl) + project.ext.set("elasticsearchDownloadLocation", "${projectDir}/build/${downloadedElasticsearchName}.tar.gz") src project.ext.elasticsearchSnapshotURL onlyIfNewer true @@ -596,7 +559,8 @@ project(":logstash-integration-tests") { systemProperty 'org.logstash.integration.specs', rubyIntegrationSpecs environment "FEATURE_FLAG", System.getenv('FEATURE_FLAG') workingDir integrationTestPwd - dependsOn = [installIntegrationTestGems, copyProductionLog4jConfiguration] + dependsOn installIntegrationTestGems + dependsOn copyProductionLog4jConfiguration } } @@ -739,46 +703,66 @@ class JDKDetails { return createElasticCatalogDownloadUrl() } - private String createElasticCatalogDownloadUrl() { - // Ask details to catalog https://jvm-catalog.elastic.co/jdk and return the url to download the JDK - - // arch x86_64 never used, only aarch64 if macos + // throws an error iff local version in versions.yml doesn't match the latest from JVM catalog. + void checkLocalVersionMatchingLatest() { + // retrieve the metadata from remote def url = "https://jvm-catalog.elastic.co/jdk/latest_adoptiumjdk_${major}_${osName}" - - // Append the cpu's arch only if Mac on aarch64, all the other OSes doesn't have CPU extension - if (arch == "aarch64") { - url += "_${arch}" - } - println "Retrieving JDK from catalog..." def catalogMetadataUrl = URI.create(url).toURL() def catalogConnection = catalogMetadataUrl.openConnection() catalogConnection.requestMethod = 'GET' assert catalogConnection.responseCode == 200 def metadataRetrieved = catalogConnection.content.text - println "Retrieved!" - def catalogMetadata = new JsonSlurper().parseText(metadataRetrieved) - return catalogMetadata.url - } - private String createAdoptDownloadUrl() { - String releaseName = major > 8 ? - "jdk-${revision}+${build}" : - "jdk${revision}u${build}" - String vendorOsName = vendorOsName(osName) - switch (vendor) { - case "adoptium": - return "https://api.adoptium.net/v3/binary/version/${releaseName}/${vendorOsName}/${arch}/jdk/hotspot/normal/adoptium" - default: - throw RuntimeException("Can't handle vendor: ${vendor}") + if (catalogMetadata.version != revision || catalogMetadata.revision != build) { + throw new GradleException("Found new jdk version. Please update version.yml to ${catalogMetadata.version} build ${catalogMetadata.revision}") } } - private String vendorOsName(String osName) { - if (osName == "darwin") - return "mac" - return osName + private String createElasticCatalogDownloadUrl() { + // Ask details to catalog https://jvm-catalog.elastic.co/jdk and return the url to download the JDK + + // arch x86_64 is default, aarch64 if macos or linux + def url = "https://jvm-catalog.elastic.co/jdk/adoptiumjdk-${revision}+${build}-${osName}" + + // Append the cpu's arch only if not x86_64, which is the default + if (arch == "aarch64") { + url += "-${arch}" + } + println "Retrieving JDK from catalog..." + def catalogMetadataUrl = URI.create(url).toURL() + def catalogConnection = catalogMetadataUrl.openConnection() + catalogConnection.requestMethod = 'GET' + if (catalogConnection.responseCode != 200) { + println "Can't find adoptiumjdk ${revision} for ${osName} on Elastic JVM catalog" + throw new GradleException("JVM not present on catalog") + } + + def metadataRetrieved = catalogConnection.content.text + println "Retrieved!" + + def catalogMetadata = new JsonSlurper().parseText(metadataRetrieved) + validateMetadata(catalogMetadata) + + return catalogMetadata.url + } + + //Verify that the artifact metadata correspond to the request, if not throws an error + private void validateMetadata(Map metadata) { + if (metadata.version != revision) { + throw new GradleException("Expected to retrieve a JDK for version ${revision} but received: ${metadata.version}") + } + if (!isSameArchitecture(metadata.architecture)) { + throw new GradleException("Expected to retrieve a JDK for architecture ${arch} but received: ${metadata.architecture}") + } + } + + private boolean isSameArchitecture(String metadataArch) { + if (arch == 'x64') { + return metadataArch == 'x86_64' + } + return metadataArch == arch } private String parseJdkArchitecture(String jdkArch) { @@ -790,16 +774,22 @@ class JDKDetails { return "aarch64" break default: - throw RuntimeException("Can't handle CPU architechture: ${jdkArch}") + throw new GradleException("Can't handle CPU architechture: ${jdkArch}") } } } tasks.register("lint") { - // Calls rake's 'lint' task + description = "Lint Ruby source files. Use -PrubySource=file1.rb,file2.rb to specify files" dependsOn installDevelopmentGems doLast { - rake(projectDir, buildDir, 'lint:report') + if (project.hasProperty("rubySource")) { + // Split the comma-separated files and pass them as separate arguments + def files = project.property("rubySource").split(",") + rake(projectDir, buildDir, "lint:report", *files) + } else { + rake(projectDir, buildDir, "lint:report") + } } } @@ -839,6 +829,15 @@ tasks.register("downloadJdk", Download) { } } +tasks.register("checkNewJdkVersion") { + def versionYml = new Yaml().load(new File("$projectDir/versions.yml").text) + + // use Linux x86_64 as canary platform + def jdkDetails = new JDKDetails(versionYml, "linux", "x86_64") + // throws Gradle exception if local and remote doesn't match + jdkDetails.checkLocalVersionMatchingLatest() +} + tasks.register("deleteLocalJdk", Delete) { // CLI project properties: -Pjdk_bundle_os=[windows|linux|darwin] String osName = selectOsType() @@ -925,4 +924,4 @@ if (System.getenv('OSS') != 'true') { tasks.register("runXPackIntegrationTests") { dependsOn copyPluginTestAlias dependsOn ":logstash-xpack:rubyIntegrationTests" - } \ No newline at end of file + } diff --git a/catalog-info.yaml b/catalog-info.yaml index e6fd31f7c..1b24f52fb 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -21,15 +21,19 @@ metadata: url: https://elastic.co/logstash spec: type: tool - owner: group:ingest-fp + owner: group:logstash system: platform-ingest + lifecycle: production dependsOn: - resource:buildkite-logstash-serverless-integration-testing - resource:logstash-snyk-report - - logstash-dra-snapshot-pipeline - - logstash-dra-staging-pipeline - - logstash-linux-jdk-matrix-pipeline - - logstash-windows-jdk-matrix-pipeline + - resource:logstash-dra-snapshot-pipeline + - resource:logstash-dra-staging-pipeline + - resource:logstash-linux-jdk-matrix-pipeline + - resource:logstash-windows-jdk-matrix-pipeline + - resource:logstash-benchmark-pipeline + - resource:logstash-health-report-tests-pipeline + - resource:logstash-jdk-availability-check-pipeline # *********************************** # Declare serverless IT pipeline @@ -43,8 +47,8 @@ metadata: description: Buildkite pipeline for the Serverless Integration Test spec: type: buildkite-pipeline - owner: group:ingest-fp - system: buildkite + owner: group:logstash + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -62,7 +66,9 @@ spec: SLACK_NOTIFICATIONS_ON_SUCCESS: 'false' SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true' teams: - ingest-fp: + logstash: + access_level: MANAGE_BUILD_AND_READ + ingest-eng-prod: access_level: MANAGE_BUILD_AND_READ everyone: access_level: READ_ONLY @@ -85,8 +91,8 @@ metadata: description: 'The logstash-snyk-report pipeline.' spec: type: buildkite-pipeline - owner: group:ingest-fp - system: buildkite + owner: group:logstash + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -136,7 +142,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -179,7 +185,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -230,7 +236,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -288,7 +294,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -339,7 +345,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -382,7 +388,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -401,6 +407,7 @@ spec: ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build' SLACK_NOTIFICATIONS_ON_SUCCESS: 'false' + SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true' teams: ingest-fp: access_level: MANAGE_BUILD_AND_READ @@ -432,7 +439,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -448,7 +455,8 @@ spec: build_pull_requests: false build_tags: false trigger_mode: code - filter_condition: 'build.branch !~ /^backport.*$/' + filter_condition: >- + build.branch !~ /^backport.*$/ && build.branch !~ /^mergify\/bp\/.*$/ filter_enabled: true cancel_intermediate_builds: false skip_intermediate_builds: false @@ -487,7 +495,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -529,7 +537,7 @@ metadata: spec: type: buildkite-pipeline owner: group:logstash - system: buildkite + system: platform-ingest implementation: apiVersion: buildkite.elastic.dev/v1 kind: Pipeline @@ -586,3 +594,212 @@ spec: # ******************************* # SECTION END: Scheduler pipeline # ******************************* + +# *********************************** +# Declare Benchmark pipeline +# *********************************** +--- +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: logstash-benchmark-pipeline + description: Buildkite pipeline for the Logstash benchmark + links: + - title: 'Logstash Benchmark (Daily, Auto) pipeline' + url: https://buildkite.com/elastic/logstash-benchmark-pipeline +spec: + type: buildkite-pipeline + owner: group:logstash + system: platform-ingest + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: logstash-benchmark-pipeline + description: ':running: The Benchmark pipeline for snapshot version' + spec: + repository: elastic/logstash + pipeline_file: ".buildkite/benchmark_pipeline.yml" + maximum_timeout_in_minutes: 90 + provider_settings: + trigger_mode: none # don't trigger jobs from github activity + env: + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'false' + SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build' + SLACK_NOTIFICATIONS_ON_SUCCESS: 'false' + SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true' + teams: + ingest-fp: + access_level: MANAGE_BUILD_AND_READ + logstash: + access_level: MANAGE_BUILD_AND_READ + ingest-eng-prod: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY + schedules: + Daily serverless test on core_serverless_test branch: + branch: main + cronline: 30 04 * * * + message: Daily trigger of Benchmark Pipeline + +# ******************************* +# SECTION END: Benchmark pipeline +# ******************************* + +# *********************************** +# SECTION START: Benchmark Marathon +# *********************************** +--- +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: logstash-benchmark-marathon-pipeline + description: Buildkite pipeline for benchmarking multi-version + links: + - title: 'Logstash Benchmark Marathon' + url: https://buildkite.com/elastic/logstash-benchmark-marathon-pipeline +spec: + type: buildkite-pipeline + owner: group:logstash + system: platform-ingest + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: logstash-benchmark-marathon-pipeline + description: ':running: The Benchmark Marathon for multi-version' + spec: + repository: elastic/logstash + pipeline_file: ".buildkite/benchmark_marathon_pipeline.yml" + maximum_timeout_in_minutes: 480 + provider_settings: + trigger_mode: none # don't trigger jobs from github activity + env: + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'false' + SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build' + SLACK_NOTIFICATIONS_ON_SUCCESS: 'false' + SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true' + teams: + ingest-fp: + access_level: MANAGE_BUILD_AND_READ + logstash: + access_level: MANAGE_BUILD_AND_READ + ingest-eng-prod: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY + +# ******************************* +# SECTION END: Benchmark Marathon +# ******************************* + +# *********************************** +# Declare Health Report Tests pipeline +# *********************************** +--- +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: logstash-health-report-tests-pipeline + description: Buildkite pipeline for the Logstash Health Report Tests + links: + - title: ':logstash Logstash Health Report Tests (Daily, Auto) pipeline' + url: https://buildkite.com/elastic/logstash-health-report-tests-pipeline +spec: + type: buildkite-pipeline + owner: group:logstash + system: platform-ingest + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: logstash-health-report-tests-pipeline + description: ':logstash: Logstash Health Report tests :pipeline:' + spec: + repository: elastic/logstash + pipeline_file: ".buildkite/health_report_tests_pipeline.yml" + maximum_timeout_in_minutes: 30 # usually tests last max ~17mins + provider_settings: + trigger_mode: none # don't trigger jobs from github activity + env: + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' + SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build' + SLACK_NOTIFICATIONS_ON_SUCCESS: 'false' + SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true' + teams: + ingest-fp: + access_level: MANAGE_BUILD_AND_READ + logstash: + access_level: MANAGE_BUILD_AND_READ + ingest-eng-prod: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY + schedules: + Daily Health Report tests on main branch: + branch: main + cronline: 30 20 * * * + message: Daily trigger of Health Report Tests Pipeline + +# ******************************* +# SECTION END: Health Report Tests pipeline +# ******************************* + +# *********************************** +# Declare JDK check pipeline +# *********************************** +--- +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: logstash-jdk-availability-check-pipeline + description: ":logstash: check availability of new JDK version" +spec: + type: buildkite-pipeline + owner: group:logstash + system: platform-ingest + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: logstash-jdk-availability-check-pipeline + spec: + repository: elastic/logstash + pipeline_file: ".buildkite/jdk_availability_check_pipeline.yml" + maximum_timeout_in_minutes: 10 + provider_settings: + trigger_mode: none # don't trigger jobs from github activity + env: + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' + SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build' + SLACK_NOTIFICATIONS_ON_SUCCESS: 'false' + SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true' + teams: + logstash: + access_level: MANAGE_BUILD_AND_READ + ingest-eng-prod: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY + schedules: + Weekly JDK availability check (main): + branch: main + cronline: 0 2 * * 1 # every Monday@2AM UTC + message: Weekly trigger of JDK update availability pipeline per branch + env: + PIPELINES_TO_TRIGGER: 'logstash-jdk-availability-check-pipeline' + Weekly JDK availability check (8.x): + branch: 8.x + cronline: 0 2 * * 1 # every Monday@2AM UTC + message: Weekly trigger of JDK update availability pipeline per branch + env: + PIPELINES_TO_TRIGGER: 'logstash-jdk-availability-check-pipeline' + +# ******************************* +# SECTION END: JDK check pipeline +# ******************************* \ No newline at end of file diff --git a/ci/acceptance_tests.sh b/ci/acceptance_tests.sh index 814eae5fe..fa844c7ca 100755 --- a/ci/acceptance_tests.sh +++ b/ci/acceptance_tests.sh @@ -19,7 +19,7 @@ function get_package_type { # uses at least 1g of memory, If we don't do this we can get OOM issues when # installing gems. See https://github.com/elastic/logstash/issues/5179 export JRUBY_OPTS="-J-Xmx1g" -export GRADLE_OPTS="-Xmx4g -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dfile.encoding=UTF-8" +export GRADLE_OPTS="-Xmx4g -Dorg.gradle.console=plain -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dfile.encoding=UTF-8" export OSS=true if [ -n "$BUILD_JAVA_HOME" ]; then diff --git a/ci/branches.json b/ci/branches.json deleted file mode 100644 index ac961a8b9..000000000 --- a/ci/branches.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "notice": "This file is not maintained outside of the main branch and should only be used for tooling.", - "branches": [ - { - "branch": "main" - }, - { - "branch": "8.13" - }, - { - "branch": "7.17" - } - ] - } diff --git a/ci/check_jdk_version_availability.sh b/ci/check_jdk_version_availability.sh new file mode 100755 index 000000000..2ce40dc7b --- /dev/null +++ b/ci/check_jdk_version_availability.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -eo pipefail + +export GRADLE_OPTS="-Xmx4g -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dfile.encoding=UTF-8" + +echo "Checking local JDK version against latest remote from JVM catalog" +./gradlew checkNewJdkVersion \ No newline at end of file diff --git a/ci/docker_acceptance_tests.sh b/ci/docker_acceptance_tests.sh index 5a3744c92..b1e62de2c 100755 --- a/ci/docker_acceptance_tests.sh +++ b/ci/docker_acceptance_tests.sh @@ -6,7 +6,7 @@ set -x # uses at least 1g of memory, If we don't do this we can get OOM issues when # installing gems. See https://github.com/elastic/logstash/issues/5179 export JRUBY_OPTS="-J-Xmx1g" -export GRADLE_OPTS="-Xmx4g -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dfile.encoding=UTF-8" +export GRADLE_OPTS="-Xmx4g -Dorg.gradle.console=plain -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dfile.encoding=UTF-8" if [ -n "$BUILD_JAVA_HOME" ]; then GRADLE_OPTS="$GRADLE_OPTS -Dorg.gradle.java.home=$BUILD_JAVA_HOME" @@ -15,7 +15,7 @@ fi # Can run either a specific flavor, or all flavors - # eg `ci/acceptance_tests.sh oss` will run tests for open source container # `ci/acceptance_tests.sh full` will run tests for the default container -# `ci/acceptance_tests.sh ubi8` will run tests for the ubi8 based container +# `ci/acceptance_tests.sh wolfi` will run tests for the wolfi based container # `ci/acceptance_tests.sh` will run tests for all containers SELECTED_TEST_SUITE=$1 @@ -48,23 +48,23 @@ if [[ $SELECTED_TEST_SUITE == "oss" ]]; then elif [[ $SELECTED_TEST_SUITE == "full" ]]; then echo "--- Building $SELECTED_TEST_SUITE docker images" cd $LS_HOME - rake artifact:docker + rake artifact:build_docker_full echo "--- Acceptance: Installing dependencies" cd $QA_DIR bundle install echo "--- Acceptance: Running the tests" bundle exec rspec docker/spec/full/*_spec.rb -elif [[ $SELECTED_TEST_SUITE == "ubi8" ]]; then +elif [[ $SELECTED_TEST_SUITE == "wolfi" ]]; then echo "--- Building $SELECTED_TEST_SUITE docker images" cd $LS_HOME - rake artifact:docker_ubi8 + rake artifact:docker_wolfi echo "--- Acceptance: Installing dependencies" cd $QA_DIR bundle install echo "--- Acceptance: Running the tests" - bundle exec rspec docker/spec/ubi8/*_spec.rb + bundle exec rspec docker/spec/wolfi/*_spec.rb else echo "--- Building all docker images" cd $LS_HOME diff --git a/ci/docker_update_base_image.sh b/ci/docker_update_base_image.sh deleted file mode 100755 index ab65ee6d7..000000000 --- a/ci/docker_update_base_image.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -ie - -if docker rmi --force logstash-base ; then - echo "Removed existing logstash-base image, building logstash-base image from scratch." -else - echo "Building logstash-base image from scratch." #Keep the global -e flag but allow the remove command to fail. -fi - -docker build -f Dockerfile.base -t logstash-base . -docker login --username=logstashci container-registry-test.elastic.co #will prompt for password -docker tag logstash-base container-registry-test.elastic.co/logstash-test/logstash-base -docker push container-registry-test.elastic.co/logstash-test/logstash-base diff --git a/ci/integration_tests.sh b/ci/integration_tests.sh index 2dae141a1..318660bc9 100755 --- a/ci/integration_tests.sh +++ b/ci/integration_tests.sh @@ -19,24 +19,15 @@ if [[ $1 = "setup" ]]; then exit 0 elif [[ $1 == "split" ]]; then - cd qa/integration - glob1=(specs/*spec.rb) - glob2=(specs/**/*spec.rb) - all_specs=("${glob1[@]}" "${glob2[@]}") + # Source shared function for splitting integration tests + source "$(dirname "${BASH_SOURCE[0]}")/partition-files.lib.sh" - specs0=${all_specs[@]::$((${#all_specs[@]} / 2 ))} - specs1=${all_specs[@]:$((${#all_specs[@]} / 2 ))} - cd ../.. - if [[ $2 == 0 ]]; then - echo "Running the first half of integration specs: $specs0" - ./gradlew runIntegrationTests -PrubyIntegrationSpecs="$specs0" --console=plain - elif [[ $2 == 1 ]]; then - echo "Running the second half of integration specs: $specs1" - ./gradlew runIntegrationTests -PrubyIntegrationSpecs="$specs1" --console=plain - else - echo "Error, must specify 0 or 1 after the split. For example ci/integration_tests.sh split 0" - exit 1 - fi + index="${2:?index}" + count="${3:-2}" + specs=($(cd qa/integration; partition_files "${index}" "${count}" < <(find specs -name '*_spec.rb') )) + + echo "Running integration tests partition[${index}] of ${count}: ${specs[*]}" + ./gradlew runIntegrationTests -PrubyIntegrationSpecs="${specs[*]}" --console=plain elif [[ ! -z $@ ]]; then echo "Running integration tests 'rspec $@'" diff --git a/ci/logstash_releases.json b/ci/logstash_releases.json index e9c8d03b3..6c921f926 100644 --- a/ci/logstash_releases.json +++ b/ci/logstash_releases.json @@ -1,13 +1,15 @@ { "releases": { - "5.x": "5.6.16", - "6.x": "6.8.23", - "7.x": "7.17.19", - "8.x": "8.13.1" + "7.current": "7.17.28", + "8.previous": "8.17.5", + "8.current": "8.18.0" }, "snapshots": { - "7.x": "7.17.20-SNAPSHOT", - "8.x": "8.13.2-SNAPSHOT", - "main": "8.14.0-SNAPSHOT" + "7.current": "7.17.29-SNAPSHOT", + "8.previous": "8.17.6-SNAPSHOT", + "8.current": "8.18.1-SNAPSHOT", + "8.next": "8.19.0-SNAPSHOT", + "9.next": "9.0.1-SNAPSHOT", + "main": "9.1.0-SNAPSHOT" } } diff --git a/ci/partition-files.lib.sh b/ci/partition-files.lib.sh new file mode 100755 index 000000000..c974921da --- /dev/null +++ b/ci/partition-files.lib.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +# partition_files returns a consistent partition of the filenames given on stdin +# Usage: partition_files < <(ls files) +# partition_index: the zero-based index of the partition to select `[0,partition_count)` +# partition_count: the number of partitions `[2,#files]` +partition_files() ( + set -e + + local files + # ensure files is consistently sorted and distinct + IFS=$'\n' read -ra files -d '' <<<"$(cat - | sort | uniq)" || true + + local partition_index="${1:?}" + local partition_count="${2:?}" + + _error () { >&2 echo "ERROR: ${1:-UNSPECIFIED}"; exit 1; } + + # safeguard against nonsense invocations + if (( ${#files[@]} < 2 )); then + _error "#files(${#files[@]}) must be at least 2 in order to partition" + elif ( ! [[ "${partition_count}" =~ ^[0-9]+$ ]] ) || (( partition_count < 2 )) || (( partition_count > ${#files[@]})); then + _error "partition_count(${partition_count}) must be a number that is at least 2 and not greater than #files(${#files[@]})" + elif ( ! [[ "${partition_index}" =~ ^[0-9]+$ ]] ) || (( partition_index < 0 )) || (( partition_index >= $partition_count )) ; then + _error "partition_index(${partition_index}) must be a number that is greater 0 and less than partition_count(${partition_count})" + fi + + # round-robbin emit those in our selected partition + for index in "${!files[@]}"; do + partition="$(( index % partition_count ))" + if (( partition == partition_index )); then + echo "${files[$index]}" + fi + done +) + +if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then + if [[ "$1" == "test" ]]; then + status=0 + + SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + file_list="$( cd "${SCRIPT_DIR}"; find . -type f )" + + # for any legal partitioning into N partitions, we ensure that + # the combined output of `partition_files I N` where `I` is all numbers in + # the range `[0,N)` produces no repeats and no omissions, even if the + # input list is not consistently ordered. + for n in $(seq 2 $(wc -l <<<"${file_list}")); do + result="" + for i in $(seq 0 $(( n - 1 ))); do + for file in $(partition_files $i $n <<<"$( shuf <<<"${file_list}" )"); do + result+="${file}"$'\n' + done + done + + repeated="$( uniq --repeated <<<"$( sort <<<"${result}" )" )" + if (( $(printf "${repeated}" | wc -l) > 0 )); then + status=1 + echo "[n=${n}]FAIL(repeated):"$'\n'"${repeated}" + fi + + missing=$( comm -23 <(sort <<<"${file_list}") <( sort <<<"${result}" ) ) + if (( $(printf "${missing}" | wc -l) > 0 )); then + status=1 + echo "[n=${n}]FAIL(omitted):"$'\n'"${missing}" + fi + done + + if (( status > 0 )); then + echo "There were failures. The input list was:" + echo "${file_list}" + fi + + exit "${status}" + else + partition_files $@ + fi +fi \ No newline at end of file diff --git a/ci/serverless/common.sh b/ci/serverless/common.sh index 4a5fb3bc2..a0d5c90d1 100755 --- a/ci/serverless/common.sh +++ b/ci/serverless/common.sh @@ -28,7 +28,9 @@ build_logstash() { } index_test_data() { - curl -X POST -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/$INDEX_NAME/_bulk" -H 'Content-Type: application/json' --data-binary @"$CURRENT_DIR/test_data/book.json" + curl -X POST -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/$INDEX_NAME/_bulk" \ + -H 'x-elastic-product-origin: logstash' \ + -H 'Content-Type: application/json' --data-binary @"$CURRENT_DIR/test_data/book.json" } # $1: check function diff --git a/ci/serverless/cpm_tests.sh b/ci/serverless/cpm_tests.sh index 16ed5dc34..14d2338bd 100755 --- a/ci/serverless/cpm_tests.sh +++ b/ci/serverless/cpm_tests.sh @@ -7,7 +7,8 @@ export PIPELINE_NAME='gen_es' # update pipeline and check response code index_pipeline() { - RESP_CODE=$(curl -s -w "%{http_code}" -X PUT -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/_logstash/pipeline/$1" -H 'Content-Type: application/json' -d "$2") + RESP_CODE=$(curl -s -w "%{http_code}" -X PUT -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/_logstash/pipeline/$1" \ + -H 'x-elastic-product-origin: logstash' -H 'Content-Type: application/json' -d "$2") if [[ $RESP_CODE -ge '400' ]]; then echo "failed to update pipeline for Central Pipeline Management. Got $RESP_CODE from Elasticsearch" exit 1 @@ -34,7 +35,7 @@ check_plugin() { } delete_pipeline() { - curl -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -X DELETE "$ES_ENDPOINT/_logstash/pipeline/$PIPELINE_NAME" -H 'Content-Type: application/json'; + curl -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' -X DELETE "$ES_ENDPOINT/_logstash/pipeline/$PIPELINE_NAME" -H 'Content-Type: application/json'; } cpm_clean_up_and_get_result() { diff --git a/ci/serverless/elastic_integration_filter_tests.sh b/ci/serverless/elastic_integration_filter_tests.sh index 3f7c121f8..dbd3ab25f 100755 --- a/ci/serverless/elastic_integration_filter_tests.sh +++ b/ci/serverless/elastic_integration_filter_tests.sh @@ -6,10 +6,12 @@ source ./$(dirname "$0")/common.sh deploy_ingest_pipeline() { PIPELINE_RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X PUT -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/_ingest/pipeline/integration-logstash_test.events-default" \ -H 'Content-Type: application/json' \ + -H 'x-elastic-product-origin: logstash' \ --data-binary @"$CURRENT_DIR/test_data/ingest_pipeline.json") TEMPLATE_RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X PUT -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/_index_template/logs-serverless-default-template" \ -H 'Content-Type: application/json' \ + -H 'x-elastic-product-origin: logstash' \ --data-binary @"$CURRENT_DIR/test_data/index_template.json") # ingest pipeline is likely be there from the last run @@ -29,7 +31,7 @@ check_integration_filter() { } get_doc_msg_length() { - curl -s -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/logs-$INDEX_NAME.004-default/_search?size=1" | jq '.hits.hits[0]._source.message | length' + curl -s -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/logs-$INDEX_NAME.004-default/_search?size=1" -H 'x-elastic-product-origin: logstash' | jq '.hits.hits[0]._source.message | length' } # ensure no double run of ingest pipeline diff --git a/ci/serverless/es_output_tests.sh b/ci/serverless/es_output_tests.sh index 6bb5e9335..788fb786a 100755 --- a/ci/serverless/es_output_tests.sh +++ b/ci/serverless/es_output_tests.sh @@ -9,7 +9,7 @@ check_named_index() { } get_data_stream_count() { - curl -s -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/logs-$INDEX_NAME.001-default/_count" | jq '.count // 0' + curl -s -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' "$ES_ENDPOINT/logs-$INDEX_NAME.001-default/_count" | jq '.count // 0' } compare_data_stream_count() { diff --git a/ci/serverless/kibana_api_tests.sh b/ci/serverless/kibana_api_tests.sh index 52f3f0f9b..86e6f6df0 100755 --- a/ci/serverless/kibana_api_tests.sh +++ b/ci/serverless/kibana_api_tests.sh @@ -10,7 +10,7 @@ export EXIT_CODE="0" create_pipeline() { RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X PUT -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME" \ - -H 'Content-Type: application/json' -H 'kbn-xsrf: logstash' \ + -H 'Content-Type: application/json' -H 'kbn-xsrf: logstash' -H 'x-elastic-product-origin: logstash' \ --data-binary @"$CURRENT_DIR/test_data/$PIPELINE_NAME.json") if [[ RESP_CODE -ge '400' ]]; then @@ -20,7 +20,8 @@ create_pipeline() { } get_pipeline() { - RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME") + RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' \ + "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME") \ SOURCE_BODY=$(cat "$CURRENT_DIR/test_data/$PIPELINE_NAME.json") RESP_PIPELINE_NAME=$(echo "$RESP_BODY" | jq -r '.id') @@ -41,7 +42,8 @@ get_pipeline() { } list_pipeline() { - RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipelines" | jq --arg name "$PIPELINE_NAME" '.pipelines[] | select(.id==$name)' ) + RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' \ + "$KB_ENDPOINT/api/logstash/pipelines" | jq --arg name "$PIPELINE_NAME" '.pipelines[] | select(.id==$name)' ) if [[ -z "$RESP_BODY" ]]; then EXIT_CODE=$(( EXIT_CODE + 1 )) echo "Fail to list pipeline." @@ -49,7 +51,8 @@ list_pipeline() { } delete_pipeline() { - RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X DELETE -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME" \ + RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X DELETE -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' \ + "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME" \ -H 'Content-Type: application/json' -H 'kbn-xsrf: logstash' \ --data-binary @"$CURRENT_DIR/test_data/$PIPELINE_NAME.json") diff --git a/ci/serverless/metricbeat_monitoring_tests.sh b/ci/serverless/metricbeat_monitoring_tests.sh index cd41d4c17..ce3e47dc7 100755 --- a/ci/serverless/metricbeat_monitoring_tests.sh +++ b/ci/serverless/metricbeat_monitoring_tests.sh @@ -40,7 +40,7 @@ stop_metricbeat() { } get_monitor_count() { - curl -s -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$ES_ENDPOINT/$INDEX_NAME/_count" | jq '.count // 0' + curl -s -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' "$ES_ENDPOINT/$INDEX_NAME/_count" | jq '.count // 0' } compare_monitor_count() { diff --git a/ci/serverless/monitoring_tests.sh b/ci/serverless/monitoring_tests.sh index 3113e4473..431fc5f2d 100755 --- a/ci/serverless/monitoring_tests.sh +++ b/ci/serverless/monitoring_tests.sh @@ -6,7 +6,7 @@ set -ex source ./$(dirname "$0")/common.sh get_monitor_count() { - curl -s -H "Authorization: ApiKey $LS_ROLE_API_KEY_ENCODED" "$ES_ENDPOINT/.monitoring-logstash-7-*/_count" | jq '.count' + curl -s -H "Authorization: ApiKey $LS_ROLE_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' "$ES_ENDPOINT/.monitoring-logstash-7-*/_count" | jq '.count' } compare_monitor_count() { diff --git a/config/jvm.options b/config/jvm.options index b729fce91..084ff034b 100644 --- a/config/jvm.options +++ b/config/jvm.options @@ -16,10 +16,6 @@ ## ################################################################ -## GC configuration -11-13:-XX:+UseConcMarkSweepGC -11-13:-XX:CMSInitiatingOccupancyFraction=75 -11-13:-XX:+UseCMSInitiatingOccupancyOnly ## Locale # Set the locale language @@ -34,7 +30,7 @@ ## basic # set the I/O temp directory -#-Djava.io.tmpdir=$HOME +#-Djava.io.tmpdir=${HOME} # set to headless, just in case -Djava.awt.headless=true @@ -59,11 +55,7 @@ #-XX:HeapDumpPath=${LOGSTASH_HOME}/heapdump.hprof ## GC logging -#-Xlog:gc*,gc+age=trace,safepoint:file=@loggc@:utctime,pid,tags:filecount=32,filesize=64m - -# log GC status to a file with time stamps -# ensure the directory exists -#-Xloggc:${LS_GC_LOG_FILE} +#-Xlog:gc*,gc+age=trace,safepoint:file=${LS_GC_LOG_FILE}:utctime,pid,tags:filecount=32,filesize=64m # Entropy source for randomness -Djava.security.egd=file:/dev/urandom @@ -79,11 +71,11 @@ # text values with sizes less than or equal to this limit will be treated as invalid. # This value should be higher than `logstash.jackson.stream-read-constraints.max-number-length`. # The jackson library defaults to 20000000 or 20MB, whereas Logstash defaults to 200MB or 200000000 characters. --Dlogstash.jackson.stream-read-constraints.max-string-length=200000000 +#-Dlogstash.jackson.stream-read-constraints.max-string-length=200000000 # # Sets the maximum number length (in chars or bytes, depending on input context). # The jackson library defaults to 1000, whereas Logstash defaults to 10000. --Dlogstash.jackson.stream-read-constraints.max-number-length=10000 +#-Dlogstash.jackson.stream-read-constraints.max-number-length=10000 # # Sets the maximum nesting depth. The depth is a count of objects and arrays that have not # been closed, `{` and `[` respectively. diff --git a/config/log4j2.properties b/config/log4j2.properties index 234b23db4..92acf87be 100644 --- a/config/log4j2.properties +++ b/config/log4j2.properties @@ -26,6 +26,12 @@ appender.rolling.policies.size.type = SizeBasedTriggeringPolicy appender.rolling.policies.size.size = 100MB appender.rolling.strategy.type = DefaultRolloverStrategy appender.rolling.strategy.max = 30 +appender.rolling.strategy.action.type = Delete +appender.rolling.strategy.action.basepath = ${sys:ls.logs} +appender.rolling.strategy.action.condition.type = IfFileName +appender.rolling.strategy.action.condition.glob = logstash-plain-* +appender.rolling.strategy.action.condition.nested_condition.type = IfLastModified +appender.rolling.strategy.action.condition.nested_condition.age = 7D appender.rolling.avoid_pipelined_filter.type = PipelineRoutingFilter appender.json_rolling.type = RollingFile @@ -43,6 +49,12 @@ appender.json_rolling.policies.size.type = SizeBasedTriggeringPolicy appender.json_rolling.policies.size.size = 100MB appender.json_rolling.strategy.type = DefaultRolloverStrategy appender.json_rolling.strategy.max = 30 +appender.json_rolling.strategy.action.type = Delete +appender.json_rolling.strategy.action.basepath = ${sys:ls.logs} +appender.json_rolling.strategy.action.condition.type = IfFileName +appender.json_rolling.strategy.action.condition.glob = logstash-json-* +appender.json_rolling.strategy.action.condition.nested_condition.type = IfLastModified +appender.json_rolling.strategy.action.condition.nested_condition.age = 7D appender.json_rolling.avoid_pipelined_filter.type = PipelineRoutingFilter appender.routing.type = PipelineRouting @@ -57,6 +69,12 @@ appender.routing.pipeline.policy.type = SizeBasedTriggeringPolicy appender.routing.pipeline.policy.size = 100MB appender.routing.pipeline.strategy.type = DefaultRolloverStrategy appender.routing.pipeline.strategy.max = 30 +appender.routing.pipeline.strategy.action.type = Delete +appender.routing.pipeline.strategy.action.basepath = ${sys:ls.logs} +appender.routing.pipeline.strategy.action.condition.type = IfFileName +appender.routing.pipeline.strategy.action.condition.glob = pipeline_${ctx:pipeline.id}*.log.gz +appender.routing.pipeline.strategy.action.condition.nested_condition.type = IfLastModified +appender.routing.pipeline.strategy.action.condition.nested_condition.age = 7D rootLogger.level = ${sys:ls.log.level} rootLogger.appenderRef.console.ref = ${sys:ls.log.format}_console @@ -136,7 +154,7 @@ appender.deprecation_rolling.policies.size.size = 100MB appender.deprecation_rolling.strategy.type = DefaultRolloverStrategy appender.deprecation_rolling.strategy.max = 30 -logger.deprecation.name = org.logstash.deprecation, deprecation +logger.deprecation.name = org.logstash.deprecation logger.deprecation.level = WARN logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_plain_rolling logger.deprecation.additivity = false diff --git a/config/logstash.yml b/config/logstash.yml index afa378a17..aeeabaf87 100644 --- a/config/logstash.yml +++ b/config/logstash.yml @@ -181,38 +181,6 @@ # # api.auth.basic.password_policy.mode: WARN # -# ------------ Module Settings --------------- -# Define modules here. Modules definitions must be defined as an array. -# The simple way to see this is to prepend each `name` with a `-`, and keep -# all associated variables under the `name` they are associated with, and -# above the next, like this: -# -# modules: -# - name: MODULE_NAME -# var.PLUGINTYPE1.PLUGINNAME1.KEY1: VALUE -# var.PLUGINTYPE1.PLUGINNAME1.KEY2: VALUE -# var.PLUGINTYPE2.PLUGINNAME1.KEY1: VALUE -# var.PLUGINTYPE3.PLUGINNAME3.KEY1: VALUE -# -# Module variable names must be in the format of -# -# var.PLUGIN_TYPE.PLUGIN_NAME.KEY -# -# modules: -# -# ------------ Cloud Settings --------------- -# Define Elastic Cloud settings here. -# Format of cloud.id is a base64 value e.g. dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy -# and it may have an label prefix e.g. staging:dXMtZ... -# This will overwrite 'var.elasticsearch.hosts' and 'var.kibana.host' -# cloud.id: -# -# Format of cloud.auth is: : -# This is optional -# If supplied this will overwrite 'var.elasticsearch.username' and 'var.elasticsearch.password' -# If supplied this will overwrite 'var.kibana.username' and 'var.kibana.password' -# cloud.auth: elastic: -# # ------------ Queuing Settings -------------- # # Internal queuing model, "memory" for legacy in-memory based queuing and @@ -314,11 +282,13 @@ # * json # # log.format: plain +# log.format.json.fix_duplicate_message_fields: true +# # path.logs: # # ------------ Other Settings -------------- # -# Allow or block running Logstash as superuser (default: true) +# Allow or block running Logstash as superuser (default: true). Windows are excluded from the checking # allow_superuser: false # # Where to find custom plugins @@ -329,13 +299,15 @@ # pipeline.separate_logs: false # # Determine where to allocate memory buffers, for plugins that leverage them. -# Default to direct, optionally can be switched to heap to select Java heap space. -# pipeline.buffer.type: direct +# Defaults to heap,but can be switched to direct if you prefer using direct memory space instead. +# pipeline.buffer.type: heap # # ------------ X-Pack Settings (not applicable for OSS build)-------------- # # X-Pack Monitoring # https://www.elastic.co/guide/en/logstash/current/monitoring-logstash.html +# Flag to allow the legacy internal monitoring (default: false) +#xpack.monitoring.allow_legacy_collection: false #xpack.monitoring.enabled: false #xpack.monitoring.elasticsearch.username: logstash_system #xpack.monitoring.elasticsearch.password: password diff --git a/devtools/backport b/devtools/backport deleted file mode 100755 index ac7e2ff04..000000000 --- a/devtools/backport +++ /dev/null @@ -1,232 +0,0 @@ -#!/usr/bin/env python3 -"""Cherry pick and backport a PR""" -from __future__ import print_function - -from builtins import input -import sys -import os -import argparse -from os.path import expanduser -import re -from subprocess import check_call, call, check_output -import requests -import json - -usage = """ - Example usage: - ./devtools/backport 7.16 2565 6490604aa0cf7fa61932a90700e6ca988fc8a527 - - In case of backporting errors, fix them, then run - git cherry-pick --continue - ./devtools/backport 7.16 2565 6490604aa0cf7fa61932a90700e6ca988fc8a527 --continue - - This script does the following: - * cleanups both from_branch and to_branch (warning: drops local changes) - * creates a temporary branch named something like "branch_2565" - * calls the git cherry-pick command in this branch - * after fixing the merge errors (if needed), pushes the branch to your - remote - * it will attempt to create a PR for you using the GitHub API, but requires - the GitHub token, with the public_repo scope, available in `~/.elastic/github.token`. - Keep in mind this token has to also be authorized to the Elastic organization as - well as to work with SSO. - (see https://help.github.com/en/articles/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on) - - Note that you need to take the commit hashes from `git log` on the - from_branch, copying the IDs from Github doesn't work in case we squashed the - PR. -""" - - -def main(): - """Main""" - parser = argparse.ArgumentParser( - description="Creates a PR for cherry-picking commits", - formatter_class=argparse.RawDescriptionHelpFormatter, - epilog=usage) - parser.add_argument("to_branch", - help="To branch (e.g 7.x)") - parser.add_argument("pr_number", - help="The PR number being merged (e.g. 2345)") - parser.add_argument("commit_hashes", metavar="hash", nargs="*", - help="The commit hashes to cherry pick." + - " You can specify multiple.") - parser.add_argument("--yes", action="store_true", - help="Assume yes. Warning: discards local changes.") - parser.add_argument("--continue", action="store_true", - help="Continue after fixing merging errors.") - parser.add_argument("--from_branch", default="main", - help="From branch") - parser.add_argument("--diff", action="store_true", - help="Display the diff before pushing the PR") - parser.add_argument("--remote", default="", - help="Which remote to push the backport branch to") - #parser.add_argument("--zube-team", default="", - # help="Team the PR belongs to") - #parser.add_argument("--keep-backport-label", action="store_true", - # help="Preserve label needs_backport in original PR") - args = parser.parse_args() - - print(args) - - create_pr(parser, args) - -def create_pr(parser, args): - info("Checking if GitHub API token is available in `~/.elastic/github.token`") - token = get_github_token() - - tmp_branch = "backport_{}_{}".format(args.pr_number, args.to_branch) - - if not vars(args)["continue"]: - if not args.yes and input("This will destroy all local changes. " + - "Continue? [y/n]: ") != "y": - return 1 - info("Destroying local changes...") - check_call("git reset --hard", shell=True) - check_call("git clean -df", shell=True) - check_call("git fetch", shell=True) - - info("Checkout of {} to backport from....".format(args.from_branch)) - check_call("git checkout {}".format(args.from_branch), shell=True) - check_call("git pull", shell=True) - - info("Checkout of {} to backport to...".format(args.to_branch)) - check_call("git checkout {}".format(args.to_branch), shell=True) - check_call("git pull", shell=True) - - info("Creating backport branch {}...".format(tmp_branch)) - call("git branch -D {} > /dev/null".format(tmp_branch), shell=True) - check_call("git checkout -b {}".format(tmp_branch), shell=True) - - if len(args.commit_hashes) == 0: - if token: - session = github_session(token) - base = "https://api.github.com/repos/elastic/logstash" - original_pr = session.get(base + "/pulls/" + args.pr_number).json() - merge_commit = original_pr['merge_commit_sha'] - if not merge_commit: - info("Could not auto resolve merge commit - PR isn't merged yet") - return 1 - info("Merge commit detected from PR: {}".format(merge_commit)) - commit_hashes = merge_commit - else: - info("GitHub API token not available. " + - "Please manually specify commit hash(es) argument(s)\n") - parser.print_help() - return 1 - else: - commit_hashes = "{}".format(" ").join(args.commit_hashes) - - info("Cherry-picking {}".format(commit_hashes)) - if call("git cherry-pick -x {}".format(commit_hashes), shell=True) != 0: - info("Looks like you have cherry-pick errors.") - info("Fix them, then run: ") - info(" git cherry-pick --continue") - info(" {} --continue".format(" ".join(sys.argv))) - return 1 - - if len(check_output("git status -s", shell=True).strip()) > 0: - info("Looks like you have uncommitted changes." + - " Please execute first: git cherry-pick --continue") - return 1 - - if len(check_output("git log HEAD...{}".format(args.to_branch), - shell=True).strip()) == 0: - info("No commit to push") - return 1 - - if args.diff: - call("git diff {}".format(args.to_branch), shell=True) - if input("Continue? [y/n]: ") != "y": - info("Aborting cherry-pick.") - return 1 - - info("Ready to push branch.") - - remote = args.remote - if not remote: - remote = input("To which remote should I push? (your fork): ") - - info("Pushing branch {} to remote {}".format(tmp_branch, remote)) - call("git push {} :{} > /dev/null".format(remote, tmp_branch), shell=True) - check_call("git push --set-upstream {} {}".format(remote, tmp_branch), shell=True) - - if not token: - info("GitHub API token not available.\n" + - "Manually create a PR by following this URL: \n\t" + - "https://github.com/elastic/logstash/compare/{}...{}:{}?expand=1" - .format(args.to_branch, remote, tmp_branch)) - else: - info("Automatically creating a PR for you...") - - session = github_session(token) - base = "https://api.github.com/repos/elastic/logstash" - original_pr = session.get(base + "/pulls/" + args.pr_number).json() - - # get the github username from the remote where we pushed - remote_url = check_output("git remote get-url {}".format(remote), shell=True) - remote_user = re.search("github.com[:/](.+)/logstash", str(remote_url)).group(1) - - # create PR - request = session.post(base + "/pulls", json=dict( - title="Backport PR #{} to {}: {}".format(args.pr_number, args.to_branch, original_pr["title"]), - head=remote_user + ":" + tmp_branch, - base=args.to_branch, - body="**Backport PR #{} to {} branch, original message:**\n\n---\n\n{}" - .format(args.pr_number, args.to_branch, original_pr["body"]) - )) - if request.status_code > 299: - info("Creating PR failed: {}".format(request.json())) - sys.exit(1) - new_pr = request.json() - - # add labels - labels = ["backport"] - # get the version (vX.Y.Z) we are backporting to - version = get_version(os.getcwd()) - if version: - labels.append(version) - - session.post( - base + "/issues/{}/labels".format(new_pr["number"]), json=labels) - - """ - if not args.keep_backport_label: - # remove needs backport label from the original PR - session.delete(base + "/issues/{}/labels/needs_backport".format(args.pr_number)) - """ - # Set a version label on the original PR - if version: - session.post( - base + "/issues/{}/labels".format(args.pr_number), json=[version]) - - info("Done. PR created: {}".format(new_pr["html_url"])) - info("Please go and check it and add the review tags") - -def get_version(base_dir): - #pattern = re.compile(r'(const\s|)\w*(v|V)ersion\s=\s"(?P.*)"') - with open(os.path.join(base_dir, "versions.yml"), "r") as f: - for line in f: - if line.startswith('logstash:'): - return "v" + line.split(':')[-1].strip() - #match = pattern.match(line) - #if match: - # return match.group('version') - -def get_github_token(): - try: - token = open(expanduser("~/.elastic/github.token"), "r").read().strip() - except: - token = False - return token - -def github_session(token): - session = requests.Session() - session.headers.update({"Authorization": "token " + token}) - return session - -def info(msg): - print("\nINFO: {}".format(msg)) - -if __name__ == "__main__": - sys.exit(main()) diff --git a/devtools/create_pr b/devtools/create_pr deleted file mode 100755 index b081a21c5..000000000 --- a/devtools/create_pr +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python3 -"""Cherry pick and backport a PR""" -from __future__ import print_function - -from builtins import input -import sys -import os -import argparse -from os.path import expanduser -import re -from subprocess import check_call, call, check_output -import requests - -usage = """ - Example usage: - ./dev-tools/create local_branch - - This script does the following: - * cleanups local_branch (warning: drops local changes) - * rebases the branch against main - * it will attempt to create a PR for you using the GitHub API, but requires - the GitHub token, with the public_repo scope, available in `~/.elastic/github.token`. - Keep in mind this token has to also be authorized to the Elastic organization as - well as to work with SSO. - (see https://help.github.com/en/articles/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on) - - Note that you need to take the commit hashes from `git log` on the - from_branch, copying the IDs from Github doesn't work in case we squashed the - PR. -""" - - -def main(): - """Main""" - parser = argparse.ArgumentParser( - description="Creates a new PR from a branch", - formatter_class=argparse.RawDescriptionHelpFormatter, - epilog=usage) - parser.add_argument("local_branch", - help="Branch to Create a PR for") - parser.add_argument("--to_branch", default="main", - help="Which remote to push the backport branch to") - parser.add_argument("--yes", action="store_true", - help="Assume yes. Warning: discards local changes.") - parser.add_argument("--continue", action="store_true", - help="Continue after fixing merging errors.") - parser.add_argument("--diff", action="store_true", - help="Display the diff before pushing the PR") - parser.add_argument("--remote", default="", - help="Which remote to push the backport branch to") - args = parser.parse_args() - - print(args) - - create_pr(args) - -def create_pr(args): - - if not vars(args)["continue"]: - if not args.yes and input("This will destroy all local changes. " + - "Continue? [y/n]: ") != "y": - return 1 - info("Destroying local changess...") - check_call("git reset --hard", shell=True) - check_call("git clean -df", shell=True) - #check_call("git fetch", shell=True) - - info("Checkout of {} to create a PR....".format(args.local_branch)) - check_call("git checkout {}".format(args.local_branch), shell=True) - check_call("git rebase {}".format(args.to_branch), shell=True) - - if args.diff: - call("git diff {}".format(args.to_branch), shell=True) - if input("Continue? [y/n]: ") != "y": - info("Aborting PR creation...") - return 1 - - info("Ready to push branch and create PR...") - - remote = args.remote - if not remote: - remote = input("To which remote should I push? (your fork): ") - - info("Pushing branch {} to remote {}".format(args.local_branch, remote)) - call("git push {} :{} > /dev/null".format(remote, args.local_branch), - shell=True) - check_call("git push --set-upstream {} {}" - .format(remote, args.local_branch), shell=True) - - info("Checking if GitHub API token is available in `~/.elastic/github.token`") - try: - token = open(expanduser("~/.elastic/github.token"), "r").read().strip() - except: - token = False - - if not token: - info("GitHub API token not available.\n" + - "Manually create a PR by following this URL: \n\t" + - "https://github.com/elastic/logstash/compare/{}...{}:{}?expand=1" - .format(args.to_branch, remote, args.local_branch)) - else: - info("Automatically creating a PR for you...") - - base = "https://api.github.com/repos/elastic/logstash" - session = requests.Session() - session.headers.update({"Authorization": "token " + token}) - - # get the github username from the remote where we pushed - remote_url = check_output("git remote get-url {}".format(remote), - shell=True) - remote_user = re.search("github.com[:/](.+)/logstash", str(remote_url)).group(1) - - ### TODO: - title = input("Title: ") - body = input("Description: ") - - # create PR - request = session.post(base + "/pulls", json=dict( - title=title, - head=remote_user + ":" + args.local_branch, - base=args.to_branch, - body=body - )) - if request.status_code > 299: - info("Creating PR failed: {}".format(request.json())) - sys.exit(1) - new_pr = request.json() - - """ - # add labels - labels = ["backport"] - # get the version we are backported to - version = get_version(os.getcwd()) - if version: - labels.append("v" + version) - - session.post( - base + "/issues/{}/labels".format(new_pr["number"]), json=labels) - - # Set a version label on the original PR - if version: - session.post( - base + "/issues/{}/labels".format(args.pr_number), json=[version]) - """ - - info("Done. PR created: {}".format(new_pr["html_url"])) - info("Please go and check it and add the review tags") - -def get_version(base_dir): - #pattern = re.compile(r'(const\s|)\w*(v|V)ersion\s=\s"(?P.*)"') - with open(os.path.join(base_dir, "versions.yml"), "r") as f: - for line in f: - if line.startswith('logstash:'): - return line.split(':')[-1].strip() - #match = pattern.match(line) - #if match: - # return match.group('version') - -def info(msg): - print("\nINFO: {}".format(msg)) - -if __name__ == "__main__": - sys.exit(main()) diff --git a/docker/Makefile b/docker/Makefile index 811201677..5fd218b67 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -2,7 +2,7 @@ SHELL=/bin/bash ELASTIC_REGISTRY ?= docker.elastic.co # Determine the version to build. -ELASTIC_VERSION := $(shell ../vendor/jruby/bin/jruby bin/elastic-version) +ELASTIC_VERSION ?= $(shell ../vendor/jruby/bin/jruby bin/elastic-version) ifdef STAGING_BUILD_NUM VERSION_TAG := $(ELASTIC_VERSION)-$(STAGING_BUILD_NUM) @@ -14,9 +14,13 @@ ifdef DOCKER_ARCHITECTURE ARCHITECTURE := $(DOCKER_ARCHITECTURE) else ARCHITECTURE := $(shell uname -m) + # For MacOS + ifeq ($(ARCHITECTURE), arm64) + ARCHITECTURE := aarch64 + endif endif -IMAGE_FLAVORS ?= oss full ubi8 +IMAGE_FLAVORS ?= oss full wolfi DEFAULT_IMAGE_FLAVOR ?= full IMAGE_TAG := $(ELASTIC_REGISTRY)/logstash/logstash @@ -26,39 +30,38 @@ all: build-from-local-artifacts build-from-local-oss-artifacts public-dockerfile # Build from artifacts on the local filesystem, using an http server (running # in a container) to provide the artifacts to the Dockerfile. -build-from-local-full-artifacts: dockerfile env2yaml +build-from-local-full-artifacts: dockerfile docker run --rm -d --name=$(HTTPD) \ -p 8000:8000 --expose=8000 -v $(ARTIFACTS_DIR):/mnt \ python:3 bash -c 'cd /mnt && python3 -m http.server' timeout 120 bash -c 'until curl -s localhost:8000 > /dev/null; do sleep 1; done' - docker build --network=host -t $(IMAGE_TAG)-full:$(VERSION_TAG) -f $(ARTIFACTS_DIR)/Dockerfile-full data/logstash || \ + docker build --progress=plain --network=host -t $(IMAGE_TAG)-full:$(VERSION_TAG) -f $(ARTIFACTS_DIR)/Dockerfile-full data/logstash || \ (docker kill $(HTTPD); false); \ docker tag $(IMAGE_TAG)-full:$(VERSION_TAG) $(IMAGE_TAG):$(VERSION_TAG); docker kill $(HTTPD) -build-from-local-oss-artifacts: dockerfile env2yaml +build-from-local-oss-artifacts: dockerfile docker run --rm -d --name=$(HTTPD) \ -p 8000:8000 --expose=8000 -v $(ARTIFACTS_DIR):/mnt \ python:3 bash -c 'cd /mnt && python3 -m http.server' timeout 120 bash -c 'until curl -s localhost:8000 > /dev/null; do sleep 1; done' - docker build --network=host -t $(IMAGE_TAG)-oss:$(VERSION_TAG) -f $(ARTIFACTS_DIR)/Dockerfile-oss data/logstash || \ + docker build --progress=plain --network=host -t $(IMAGE_TAG)-oss:$(VERSION_TAG) -f $(ARTIFACTS_DIR)/Dockerfile-oss data/logstash || \ (docker kill $(HTTPD); false); -docker kill $(HTTPD) -build-from-local-ubi8-artifacts: dockerfile env2yaml +build-from-local-wolfi-artifacts: dockerfile docker run --rm -d --name=$(HTTPD) \ -p 8000:8000 --expose=8000 -v $(ARTIFACTS_DIR):/mnt \ python:3 bash -c 'cd /mnt && python3 -m http.server' timeout 120 bash -c 'until curl -s localhost:8000 > /dev/null; do sleep 1; done' - docker build --network=host -t $(IMAGE_TAG)-ubi8:$(VERSION_TAG) -f $(ARTIFACTS_DIR)/Dockerfile-ubi8 data/logstash || \ + docker build --progress=plain --network=host -t $(IMAGE_TAG)-wolfi:$(VERSION_TAG) -f $(ARTIFACTS_DIR)/Dockerfile-wolfi data/logstash || \ (docker kill $(HTTPD); false); -docker kill $(HTTPD) COPY_FILES := $(ARTIFACTS_DIR)/docker/config/pipelines.yml $(ARTIFACTS_DIR)/docker/config/logstash-oss.yml $(ARTIFACTS_DIR)/docker/config/logstash-full.yml COPY_FILES += $(ARTIFACTS_DIR)/docker/config/log4j2.file.properties $(ARTIFACTS_DIR)/docker/config/log4j2.properties +COPY_FILES += $(ARTIFACTS_DIR)/docker/env2yaml/env2yaml.go $(ARTIFACTS_DIR)/docker/env2yaml/go.mod $(ARTIFACTS_DIR)/docker/env2yaml/go.sum COPY_FILES += $(ARTIFACTS_DIR)/docker/pipeline/default.conf $(ARTIFACTS_DIR)/docker/bin/docker-entrypoint -COPY_FILES += $(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-arm64 -COPY_FILES += $(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-amd64 $(ARTIFACTS_DIR)/docker/config/pipelines.yml: data/logstash/config/pipelines.yml $(ARTIFACTS_DIR)/docker/config/logstash-oss.yml: data/logstash/config/logstash-oss.yml @@ -67,8 +70,9 @@ $(ARTIFACTS_DIR)/docker/config/log4j2.file.properties: data/logstash/config/log4 $(ARTIFACTS_DIR)/docker/config/log4j2.properties: data/logstash/config/log4j2.properties $(ARTIFACTS_DIR)/docker/pipeline/default.conf: data/logstash/pipeline/default.conf $(ARTIFACTS_DIR)/docker/bin/docker-entrypoint: data/logstash/bin/docker-entrypoint -$(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-arm64: data/logstash/env2yaml/env2yaml-arm64 -$(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-amd64: data/logstash/env2yaml/env2yaml-amd64 +$(ARTIFACTS_DIR)/docker/env2yaml/env2yaml.go: data/logstash/env2yaml/env2yaml.go +$(ARTIFACTS_DIR)/docker/env2yaml/go.mod: data/logstash/env2yaml/go.mod +$(ARTIFACTS_DIR)/docker/env2yaml/go.sum: data/logstash/env2yaml/go.sum $(ARTIFACTS_DIR)/docker/%: cp -f $< $@ @@ -109,7 +113,7 @@ ironbank_docker_paths: mkdir -p $(ARTIFACTS_DIR)/ironbank/scripts/go/src/env2yaml/vendor mkdir -p $(ARTIFACTS_DIR)/ironbank/scripts/pipeline -public-dockerfiles: public-dockerfiles_oss public-dockerfiles_full public-dockerfiles_ubi8 public-dockerfiles_ironbank +public-dockerfiles: public-dockerfiles_oss public-dockerfiles_full public-dockerfiles_wolfi public-dockerfiles_ironbank public-dockerfiles_full: templates/Dockerfile.erb docker_paths $(COPY_FILES) ../vendor/jruby/bin/jruby -S erb -T "-"\ @@ -125,6 +129,13 @@ public-dockerfiles_full: templates/Dockerfile.erb docker_paths $(COPY_FILES) cp $(ARTIFACTS_DIR)/Dockerfile-full Dockerfile && \ tar -zcf ../logstash-$(VERSION_TAG)-docker-build-context.tar.gz Dockerfile bin config env2yaml pipeline +build-from-dockerfiles_full: public-dockerfiles_full + cd $(ARTIFACTS_DIR)/docker && \ + mkdir -p dockerfile_build_full && cd dockerfile_build_full && \ + tar -zxf ../../logstash-$(VERSION_TAG)-docker-build-context.tar.gz && \ + sed 's/artifacts/snapshots/g' Dockerfile > Dockerfile.tmp && mv Dockerfile.tmp Dockerfile && \ + docker build --progress=plain --network=host -t $(IMAGE_TAG)-dockerfile-full:$(VERSION_TAG) . + public-dockerfiles_oss: templates/Dockerfile.erb docker_paths $(COPY_FILES) ../vendor/jruby/bin/jruby -S erb -T "-"\ created_date="${BUILD_DATE}" \ @@ -139,21 +150,35 @@ public-dockerfiles_oss: templates/Dockerfile.erb docker_paths $(COPY_FILES) cp $(ARTIFACTS_DIR)/Dockerfile-oss Dockerfile && \ tar -zcf ../logstash-oss-$(VERSION_TAG)-docker-build-context.tar.gz Dockerfile bin config env2yaml pipeline -public-dockerfiles_ubi8: templates/Dockerfile.erb docker_paths $(COPY_FILES) +build-from-dockerfiles_oss: public-dockerfiles_oss + cd $(ARTIFACTS_DIR)/docker && \ + mkdir -p dockerfile_build_oss && cd dockerfile_build_oss && \ + tar -zxf ../../logstash-$(VERSION_TAG)-docker-build-context.tar.gz && \ + sed 's/artifacts/snapshots/g' Dockerfile > Dockerfile.tmp && mv Dockerfile.tmp Dockerfile && \ + docker build --progress=plain --network=host -t $(IMAGE_TAG)-dockerfile-oss:$(VERSION_TAG) . + +public-dockerfiles_wolfi: templates/Dockerfile.erb docker_paths $(COPY_FILES) ../vendor/jruby/bin/jruby -S erb -T "-"\ created_date="${BUILD_DATE}" \ elastic_version="${ELASTIC_VERSION}" \ arch="${ARCHITECTURE}" \ version_tag="${VERSION_TAG}" \ release="${RELEASE}" \ - image_flavor="ubi8" \ + image_flavor="wolfi" \ local_artifacts="false" \ - templates/Dockerfile.erb > "${ARTIFACTS_DIR}/Dockerfile-ubi8" && \ + templates/Dockerfile.erb > "${ARTIFACTS_DIR}/Dockerfile-wolfi" && \ cd $(ARTIFACTS_DIR)/docker && \ - cp $(ARTIFACTS_DIR)/Dockerfile-ubi8 Dockerfile && \ - tar -zcf ../logstash-ubi8-$(VERSION_TAG)-docker-build-context.tar.gz Dockerfile bin config env2yaml pipeline + cp $(ARTIFACTS_DIR)/Dockerfile-wolfi Dockerfile && \ + tar -zcf ../logstash-wolfi-$(VERSION_TAG)-docker-build-context.tar.gz Dockerfile bin config env2yaml pipeline -public-dockerfiles_ironbank: templates/hardening_manifest.yaml.erb templates/Dockerfile.erb ironbank_docker_paths $(COPY_IRONBANK_FILES) +build-from-dockerfiles_wolfi: public-dockerfiles_wolfi + cd $(ARTIFACTS_DIR)/docker && \ + mkdir -p dockerfile_build_wolfi && cd dockerfile_build_wolfi && \ + tar -zxf ../../logstash-$(VERSION_TAG)-docker-build-context.tar.gz && \ + sed 's/artifacts/snapshots/g' Dockerfile > Dockerfile.tmp && mv Dockerfile.tmp Dockerfile && \ + docker build --progress=plain --network=host -t $(IMAGE_TAG)-dockerfile-wolfi:$(VERSION_TAG) . + +public-dockerfiles_ironbank: templates/hardening_manifest.yaml.erb templates/IronbankDockerfile.erb ironbank_docker_paths $(COPY_IRONBANK_FILES) ../vendor/jruby/bin/jruby -S erb -T "-"\ elastic_version="${ELASTIC_VERSION}" \ templates/hardening_manifest.yaml.erb > $(ARTIFACTS_DIR)/ironbank/hardening_manifest.yaml && \ @@ -165,35 +190,11 @@ public-dockerfiles_ironbank: templates/hardening_manifest.yaml.erb templates/Doc release="${RELEASE}" \ image_flavor="ironbank" \ local_artifacts="false" \ - templates/Dockerfile.erb > "${ARTIFACTS_DIR}/Dockerfile-ironbank" && \ + templates/IronbankDockerfile.erb > "${ARTIFACTS_DIR}/Dockerfile-ironbank" && \ cd $(ARTIFACTS_DIR)/ironbank && \ cp $(ARTIFACTS_DIR)/Dockerfile-ironbank Dockerfile && \ tar -zcf ../logstash-ironbank-$(VERSION_TAG)-docker-build-context.tar.gz scripts Dockerfile hardening_manifest.yaml LICENSE README.md -# Push the image to the dedicated push endpoint at "push.docker.elastic.co" -push: - $(foreach FLAVOR, $(IMAGE_FLAVORS), \ - docker tag $(IMAGE_TAG)-$(FLAVOR):$(VERSION_TAG) push.$(IMAGE_TAG)-$(FLAVOR):$(VERSION_TAG); \ - docker push push.$(IMAGE_TAG)-$(FLAVOR):$(VERSION_TAG); \ - docker rmi push.$(IMAGE_TAG)-$(FLAVOR):$(VERSION_TAG); \ - ) - # Also push the default version, with no suffix like '-oss' or '-full' - docker tag $(IMAGE_TAG):$(VERSION_TAG) push.$(IMAGE_TAG):$(VERSION_TAG); - docker push push.$(IMAGE_TAG):$(VERSION_TAG); - docker rmi push.$(IMAGE_TAG):$(VERSION_TAG); - -# Compile "env2yaml", the helper for configuring logstash.yml via environment -# variables. -env2yaml: - docker run --rm \ - -v "$(PWD)/data/logstash/env2yaml:/usr/src/env2yaml" \ - -e GOARCH=arm64 -e GOOS=linux \ - -w /usr/src/env2yaml golang:1 go build -o /usr/src/env2yaml/env2yaml-arm64 - docker run --rm \ - -v "$(PWD)/data/logstash/env2yaml:/usr/src/env2yaml" \ - -e GOARCH=amd64 -e GOOS=linux \ - -w /usr/src/env2yaml golang:1 go build -o /usr/src/env2yaml/env2yaml-amd64 - # Generate the Dockerfiles from ERB templates. dockerfile: templates/Dockerfile.erb $(foreach FLAVOR, $(IMAGE_FLAVORS), \ @@ -203,7 +204,7 @@ dockerfile: templates/Dockerfile.erb arch="${ARCHITECTURE}" \ version_tag="${VERSION_TAG}" \ image_flavor="${FLAVOR}" \ - local_artifacts="true" \ + local_artifacts="${LOCAL_ARTIFACTS}" \ templates/Dockerfile.erb > "${ARTIFACTS_DIR}/Dockerfile-${FLAVOR}" ; \ ) diff --git a/docker/data/logstash/config/logstash-full.yml b/docker/data/logstash/config/logstash-full.yml index 58e1a35d0..949b46772 100644 --- a/docker/data/logstash/config/logstash-full.yml +++ b/docker/data/logstash/config/logstash-full.yml @@ -1,2 +1,2 @@ -http.host: "0.0.0.0" +api.http.host: "0.0.0.0" xpack.monitoring.elasticsearch.hosts: [ "http://elasticsearch:9200" ] diff --git a/docker/data/logstash/config/logstash-oss.yml b/docker/data/logstash/config/logstash-oss.yml index 342d19af8..979a5ca84 100644 --- a/docker/data/logstash/config/logstash-oss.yml +++ b/docker/data/logstash/config/logstash-oss.yml @@ -1 +1 @@ -http.host: "0.0.0.0" +api.http.host: "0.0.0.0" diff --git a/docker/data/logstash/env2yaml/env2yaml.go b/docker/data/logstash/env2yaml/env2yaml.go index e89997854..dc2641edf 100644 --- a/docker/data/logstash/env2yaml/env2yaml.go +++ b/docker/data/logstash/env2yaml/env2yaml.go @@ -16,12 +16,13 @@ package main import ( "errors" - "gopkg.in/yaml.v2" + "fmt" "io/ioutil" "log" "os" "strings" - "fmt" + + "gopkg.in/yaml.v2" ) var validSettings = []string{ @@ -49,7 +50,6 @@ var validSettings = []string{ "config.debug", "config.support_escapes", "config.field_reference.escape_style", - "event_api.tags.illegal", "queue.type", "path.queue", "queue.page_capacity", @@ -65,13 +65,9 @@ var validSettings = []string{ "dead_letter_queue.storage_policy", "dead_letter_queue.retain.age", "path.dead_letter_queue", - "http.enabled", // DEPRECATED: prefer `api.enabled` - "http.environment", // DEPRECATED: prefer `api.environment` - "http.host", // DEPRECATED: prefer `api.http.host` - "http.port", // DEPRECATED: prefer `api.http.port` "log.level", "log.format", - "modules", + "log.format.json.fix_duplicate_message_fields", "metric.collect", "path.logs", "path.plugins", @@ -86,6 +82,7 @@ var validSettings = []string{ "api.auth.basic.password_policy.include.symbol", "allow_superuser", "monitoring.cluster_uuid", + "xpack.monitoring.allow_legacy_collection", "xpack.monitoring.enabled", "xpack.monitoring.collection.interval", "xpack.monitoring.elasticsearch.hosts", @@ -129,8 +126,6 @@ var validSettings = []string{ "xpack.management.elasticsearch.ssl.cipher_suites", "xpack.geoip.download.endpoint", "xpack.geoip.downloader.enabled", - "cloud.id", - "cloud.auth", } // Given a setting name, return a downcased version with delimiters removed. diff --git a/docker/templates/Dockerfile.erb b/docker/templates/Dockerfile.erb index 1dabe6192..48fc4dc46 100644 --- a/docker/templates/Dockerfile.erb +++ b/docker/templates/Dockerfile.erb @@ -1,205 +1,128 @@ # This Dockerfile was generated from templates/Dockerfile.erb -<% if image_flavor == 'ironbank' -%> -<%# Start image_flavor 'ironbank' %> -ARG BASE_REGISTRY=registry1.dso.mil -ARG BASE_IMAGE=ironbank/redhat/ubi/ubi9 -ARG BASE_TAG=9.3 -ARG LOGSTASH_VERSION=<%= elastic_version %> -ARG GOLANG_VERSION=1.21.8 +<%# image_flavor 'full', oss', 'wolfi' -%> +<% if local_artifacts == 'false' -%> + <% url_root = 'https://artifacts.elastic.co/downloads/logstash' -%> +<% else -%> + <% url_root = 'http://localhost:8000' -%> +<% end -%> +<% if image_flavor == 'oss' -%> + <% tarball = "logstash-oss-#{elastic_version}-linux-#{arch}.tar.gz" -%> + <% license = 'Apache 2.0' -%> +<% else -%> + <% tarball = "logstash-#{elastic_version}-linux-#{arch}.tar.gz" -%> + <% license = 'Elastic License' -%> +<% end -%> +<% if image_flavor == 'full' || image_flavor == 'oss' -%> + <% base_image = 'redhat/ubi9-minimal:latest' -%> + <% go_image = 'golang:1.23' -%> + <% package_manager = 'microdnf' -%> +<% else -%> + <% base_image = 'docker.elastic.co/wolfi/chainguard-base' -%> + <% go_image = 'docker.elastic.co/wolfi/go:1.23' -%> + <% package_manager = 'apk' -%> +<% end -%> +<% locale = 'C.UTF-8' -%> -# stage 1: build env2yaml -FROM ${BASE_REGISTRY}/google/golang/ubi9/golang-1.21:${GOLANG_VERSION} AS env2yaml +# Build env2yaml +FROM <%= go_image %> AS builder-env2yaml -ENV GOPATH=/go +COPY env2yaml/env2yaml.go env2yaml/go.mod env2yaml/go.sum /tmp/go/src/env2yaml/ -COPY scripts/go /go +WORKDIR /tmp/go/src/env2yaml -USER root +RUN go build -trimpath -RUN dnf-3 -y upgrade && dnf-3 install -y git && \ - cd /go/src/env2yaml && \ - go build +# Build main image +# Minimal distributions do not ship with en language packs. +FROM <%= base_image %> -# Final stage -FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} - -ARG LOGSTASH_VERSION - -ENV ELASTIC_CONTAINER true +ENV ELASTIC_CONTAINER=true ENV PATH=/usr/share/logstash/bin:$PATH +ENV LANG=<%= locale %> LC_ALL=<%= locale %> WORKDIR /usr/share -COPY --from=env2yaml /go/src/env2yaml/env2yaml /usr/local/bin/env2yaml -COPY scripts/config/* config/ -COPY scripts/pipeline/default.conf pipeline/logstash.conf -COPY scripts/bin/docker-entrypoint /usr/local/bin/ -COPY logstash-${LOGSTASH_VERSION}-linux-x86_64.tar.gz /tmp/logstash.tar.gz - -RUN dnf -y upgrade && \ - dnf install -y procps findutils tar gzip which shadow-utils && \ - dnf clean all && \ - groupadd --gid 1000 logstash && \ - adduser --uid 1000 --gid 1000 --home-dir /usr/share/logstash --no-create-home logstash && \ - tar -zxf /tmp/logstash.tar.gz -C /usr/share/ && \ - mv /usr/share/logstash-${LOGSTASH_VERSION} /usr/share/logstash && \ - chown -R 1000:0 /usr/share/logstash && \ - chown --recursive logstash:logstash /usr/share/logstash/ && \ - chown -R logstash:root /usr/share/logstash config/ pipeline/ && \ - chmod -R g=u /usr/share/logstash && \ - mv config/* /usr/share/logstash/config && \ - mv pipeline /usr/share/logstash/pipeline && \ - mkdir /licenses/ && \ - mv /usr/share/logstash/NOTICE.TXT /licenses/NOTICE.TXT && \ - mv /usr/share/logstash/LICENSE.txt /licenses/LICENSE.txt && \ - ln -s /usr/share/logstash /opt/logstash && \ - chmod 0755 /usr/local/bin/docker-entrypoint && \ - rmdir config && \ - rm /tmp/logstash.tar.gz -<%# End image_flavor 'ironbank' %> -<% else -%> -<%# Start image_flavor 'full', oss', 'ubi8' %> - <% if local_artifacts == 'false' -%> - <% url_root = 'https://artifacts.elastic.co/downloads/logstash' -%> - <% else -%> - <% url_root = 'http://localhost:8000' -%> - <% end -%> - <% if image_flavor == 'oss' -%> - <% tarball = "logstash-oss-#{elastic_version}-linux-$(arch).tar.gz" -%> - <% license = 'Apache 2.0' -%> - <% else -%> - <% tarball = "logstash-#{elastic_version}-linux-$(arch).tar.gz" -%> - <% license = 'Elastic License' -%> - <% end -%> - <% if image_flavor == 'ubi8' %> - <% base_image = 'docker.elastic.co/ubi8/ubi-minimal' -%> - <% package_manager = 'microdnf' -%> - <% arch_command = 'uname -m' -%> - # Minimal distributions do not ship with en language packs. - <% locale = 'C.UTF-8' -%> - <% else -%> - <% base_image = 'ubuntu:20.04' -%> - <% package_manager = 'apt-get' -%> - <% locale = 'en_US.UTF-8' -%> - <% arch_command = 'dpkg --print-architecture' -%> - <% end -%> - -FROM <%= base_image %> - +# Install packages RUN for iter in {1..10}; do \ <% if image_flavor == 'full' || image_flavor == 'oss' -%> - export DEBIAN_FRONTEND=noninteractive && \ -<% end -%> -<%= package_manager %> update -y && \ -<%= package_manager %> upgrade -y && \ -<%= package_manager %> install -y procps findutils tar gzip && \ -<% if image_flavor == 'ubi8' -%> + <%= package_manager %> update -y && \ + <%= package_manager %> install -y procps findutils tar gzip && \ <%= package_manager %> install -y openssl && \ -<% end -%> -<% if image_flavor == 'ubi8' -%> <%= package_manager %> install -y which shadow-utils && \ -<% else -%> - <%= package_manager %> install -y locales && \ + <%= package_manager %> clean all && \ +<% else -%><%# 'wolfi' -%> + <%= package_manager %> add --no-cache curl bash openssl && \ <% end -%> -<% if image_flavor != 'ubi9' -%> - <%= package_manager %> install -y curl && \ -<% end -%> -<%= package_manager %> clean all && \ -<% if image_flavor == 'full' || image_flavor == 'oss' -%> - locale-gen 'en_US.UTF-8' && \ - <%= package_manager %> clean metadata && \ -<% end -%> -exit_code=0 && break || exit_code=$? && \ -echo "packaging error: retry $iter in 10s" && \ -<%= package_manager %> clean all && \ -<% if image_flavor == 'full' || image_flavor == 'oss' -%> - <%= package_manager %> clean metadata && \ -<% end -%> -sleep 10; done; \ -(exit $exit_code) + exit_code=0 && break || \ + exit_code=$? && echo "packaging error: retry $iter in 10s" && \ + <%= package_manager %> clean all && sleep 10; \ + done; \ + (exit $exit_code) -# Provide a non-root user to run the process. +# Provide a non-root user to run the process +# Add Logstash itself and set permissions +<% if image_flavor == 'full' || image_flavor == 'oss' -%> RUN groupadd --gid 1000 logstash && \ - adduser --uid 1000 --gid 1000 --home /usr/share/logstash --no-create-home logstash - -# Add Logstash itself. -RUN curl -Lo - <%= url_root %>/<%= tarball %> | \ + adduser --uid 1000 --gid 1000 \ + --home "/usr/share/logstash" \ + --no-create-home \ + logstash && \ +<% else -%><%# 'wolfi' -%> +RUN addgroup -g 1000 logstash && \ + adduser -u 1000 -G logstash \ + --disabled-password \ + --gecos "" \ + --home "/usr/share/logstash" \ + --shell "/sbin/nologin" \ + --no-create-home \ + logstash && \ +<% end -%> + curl -Lo - <%= url_root %>/<%= tarball %> | \ tar zxf - -C /usr/share && \ mv /usr/share/logstash-<%= elastic_version %> /usr/share/logstash && \ - chown --recursive logstash:logstash /usr/share/logstash/ && \ chown -R logstash:root /usr/share/logstash && \ chmod -R g=u /usr/share/logstash && \ - mkdir /licenses/ && \ + mkdir /licenses && \ mv /usr/share/logstash/NOTICE.TXT /licenses/NOTICE.TXT && \ mv /usr/share/logstash/LICENSE.txt /licenses/LICENSE.txt && \ find /usr/share/logstash -type d -exec chmod g+s {} \; && \ ln -s /usr/share/logstash /opt/logstash -WORKDIR /usr/share/logstash -ENV ELASTIC_CONTAINER true -ENV PATH=/usr/share/logstash/bin:$PATH - -# Provide a minimal configuration, so that simple invocations will provide -# a good experience. +COPY --from=builder-env2yaml /tmp/go/src/env2yaml/env2yaml /usr/local/bin/env2yaml +COPY --chown=logstash:root config/pipelines.yml config/log4j2.properties config/log4j2.file.properties /usr/share/logstash/config/ <% if image_flavor == 'oss' -%> - COPY config/logstash-oss.yml config/logstash.yml -<% else -%> - COPY config/logstash-full.yml config/logstash.yml +COPY --chown=logstash:root config/logstash-oss.yml /usr/share/logstash/config/logstash.yml +<% else -%><%# 'full', 'wolfi' -%> +COPY --chown=logstash:root config/logstash-full.yml /usr/share/logstash/config/logstash.yml <% end -%> -COPY config/pipelines.yml config/log4j2.properties config/log4j2.file.properties config/ -COPY pipeline/default.conf pipeline/logstash.conf -COPY env2yaml/env2yaml-amd64 env2yaml/env2yaml-arm64 env2yaml/ +COPY --chown=logstash:root pipeline/default.conf /usr/share/logstash/pipeline/logstash.conf +COPY --chmod=0755 bin/docker-entrypoint /usr/local/bin/ -RUN chown --recursive logstash:root config/ pipeline/ -# Ensure Logstash gets the correct locale by default. -ENV LANG=<%= locale %> LC_ALL=<%= locale %> - -# Copy over the appropriate env2yaml artifact -RUN env2yamlarch="$(<%= arch_command %>)"; \ - case "${env2yamlarch}" in \ - 'x86_64'|'amd64') \ - env2yamlarch=amd64; \ - ;; \ - 'aarch64'|'arm64') \ - env2yamlarch=arm64; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$env2yamlarch'"; exit 1 ;; \ - esac; \ - cp env2yaml/env2yaml-${env2yamlarch} /usr/local/bin/env2yaml; \ - rm -rf env2yaml -# Place the startup wrapper script. -COPY bin/docker-entrypoint /usr/local/bin/ - -RUN chmod 0755 /usr/local/bin/docker-entrypoint -<%# End image_flavor 'full', oss', 'ubi8' %> -<% end -%> +WORKDIR /usr/share/logstash USER 1000 EXPOSE 9600 5044 -<% if image_flavor != 'ironbank' -%> -LABEL org.label-schema.schema-version="1.0" \ - org.label-schema.vendor="Elastic" \ - org.opencontainers.image.vendor="Elastic" \ +LABEL org.label-schema.build-date=<%= created_date %> \ + org.label-schema.license="<%= license %>" \ org.label-schema.name="logstash" \ - org.opencontainers.image.title="logstash" \ - org.label-schema.version="<%= elastic_version %>" \ - org.opencontainers.image.version="<%= elastic_version %>" \ + org.label-schema.schema-version="1.0" \ org.label-schema.url="https://www.elastic.co/products/logstash" \ org.label-schema.vcs-url="https://github.com/elastic/logstash" \ - org.label-schema.license="<%= license %>" \ - org.opencontainers.image.licenses="<%= license %>" \ + org.label-schema.vendor="Elastic" \ + org.label-schema.version="<%= elastic_version %>" \ + org.opencontainers.image.created=<%= created_date %> \ org.opencontainers.image.description="Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite 'stash.'" \ - org.label-schema.build-date=<%= created_date %> \ -<% if image_flavor == 'ubi8' -%> license="<%= license %>" \ + org.opencontainers.image.licenses="<%= license %>" \ + org.opencontainers.image.title="logstash" \ + org.opencontainers.image.vendor="Elastic" \ + org.opencontainers.image.version="<%= elastic_version %>" \ description="Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite 'stash.'" \ - name="logstash" \ + license="<%= license %>" \ maintainer="info@elastic.co" \ + name="logstash" \ summary="Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite 'stash.'" \ - vendor="Elastic" \ -<% end -%> - org.opencontainers.image.created=<%= created_date %> -<% end -%> + vendor="Elastic" ENTRYPOINT ["/usr/local/bin/docker-entrypoint"] diff --git a/docker/templates/IronbankDockerfile.erb b/docker/templates/IronbankDockerfile.erb new file mode 100644 index 000000000..77f7ecab8 --- /dev/null +++ b/docker/templates/IronbankDockerfile.erb @@ -0,0 +1,65 @@ +# This Dockerfile was generated from templates/IronbankDockerfile.erb + +ARG BASE_REGISTRY=registry1.dso.mil +ARG BASE_IMAGE=ironbank/redhat/ubi/ubi9 +ARG BASE_TAG=9.5 +ARG LOGSTASH_VERSION=<%= elastic_version %> +ARG GOLANG_VERSION=1.21.8 + +# stage 1: build env2yaml +FROM ${BASE_REGISTRY}/google/golang/ubi9/golang-1.21:${GOLANG_VERSION} AS env2yaml + +ENV GOPATH=/go + +COPY scripts/go /go + +USER root + +RUN dnf-3 -y upgrade && dnf-3 install -y git && \ + cd /go/src/env2yaml && \ + go build + +# Final stage +FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} + +ARG LOGSTASH_VERSION + +ENV ELASTIC_CONTAINER true +ENV PATH=/usr/share/logstash/bin:$PATH + +WORKDIR /usr/share + +COPY --from=env2yaml /go/src/env2yaml/env2yaml /usr/local/bin/env2yaml +COPY scripts/config/* config/ +COPY scripts/pipeline/default.conf pipeline/logstash.conf +COPY scripts/bin/docker-entrypoint /usr/local/bin/ +COPY logstash-${LOGSTASH_VERSION}-linux-x86_64.tar.gz /tmp/logstash.tar.gz + +RUN dnf -y upgrade && \ + dnf install -y procps findutils tar gzip which shadow-utils && \ + dnf clean all && \ + groupadd --gid 1000 logstash && \ + adduser --uid 1000 --gid 1000 --home-dir /usr/share/logstash --no-create-home logstash && \ + tar -zxf /tmp/logstash.tar.gz -C /usr/share/ && \ + mv /usr/share/logstash-${LOGSTASH_VERSION} /usr/share/logstash && \ + chown -R 1000:0 /usr/share/logstash && \ + chown --recursive logstash:logstash /usr/share/logstash/ && \ + chown -R logstash:root /usr/share/logstash config/ pipeline/ && \ + chmod -R g=u /usr/share/logstash && \ + mv config/* /usr/share/logstash/config && \ + mv pipeline /usr/share/logstash/pipeline && \ + mkdir /licenses/ && \ + mv /usr/share/logstash/NOTICE.TXT /licenses/NOTICE.TXT && \ + mv /usr/share/logstash/LICENSE.txt /licenses/LICENSE.txt && \ + ln -s /usr/share/logstash /opt/logstash && \ + chmod 0755 /usr/local/bin/docker-entrypoint && \ + rmdir config && \ + rm /tmp/logstash.tar.gz + +WORKDIR /usr/share/logstash + +USER 1000 + +EXPOSE 9600 5044 + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint"] diff --git a/docker/templates/hardening_manifest.yaml.erb b/docker/templates/hardening_manifest.yaml.erb index dd24d670c..44c170838 100644 --- a/docker/templates/hardening_manifest.yaml.erb +++ b/docker/templates/hardening_manifest.yaml.erb @@ -14,7 +14,7 @@ tags: # Build args passed to Dockerfile ARGs args: BASE_IMAGE: "redhat/ubi/ubi9" - BASE_TAG: "9.3" + BASE_TAG: "9.5" LOGSTASH_VERSION: "<%= elastic_version %>" GOLANG_VERSION: "1.21.8" diff --git a/docs/docset.yml b/docs/docset.yml new file mode 100644 index 000000000..b234d9849 --- /dev/null +++ b/docs/docset.yml @@ -0,0 +1,46 @@ +project: 'Logstash' +cross_links: + - beats + - docs-content + - ecs + - elasticsearch + - integration-docs + - logstash-docs-md + - search-ui +toc: + - toc: reference + - toc: release-notes + - toc: extend +subs: + logstash-ref: "https://www.elastic.co/guide/en/logstash/current" + ecloud: "Elastic Cloud" + esf: "Elastic Serverless Forwarder" + ess: "Elasticsearch Service" + serverless-full: "Elastic Cloud Serverless" + serverless-short: "Serverless" + es-serverless: "Elasticsearch Serverless" + agent: "Elastic Agent" + fleet: "Fleet" + integrations: "Integrations" + stack: "Elastic Stack" + xpack: "X-Pack" + es: "Elasticsearch" + kib: "Kibana" + ls: "Logstash" + beats: "Beats" + filebeat: "Filebeat" + metricbeat: "Metricbeat" + winlogbeat: "Winlogbeat" + security: "X-Pack security" + security-features: "security features" + monitoring: "X-Pack monitoring" + monitor-features: "monitoring features" + stack-monitor-features: "Elastic Stack monitoring features" + ilm: "index lifecycle management" + ilm-cap: "Index lifecycle management" + ilm-init: "ILM" + dlm: "data lifecycle management" + dlm-init: "DLM" + stack-version: "9.0.0" + major-version: "9.x" + docker-repo: "docker.elastic.co/logstash/logstash" diff --git a/docs/extend/codec-new-plugin.md b/docs/extend/codec-new-plugin.md new file mode 100644 index 000000000..6ab967c81 --- /dev/null +++ b/docs/extend/codec-new-plugin.md @@ -0,0 +1,636 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/codec-new-plugin.html +--- + +# How to write a Logstash codec plugin [codec-new-plugin] + +To develop a new codec for Logstash, build a self-contained Ruby gem whose source code lives in its own GitHub repository. The Ruby gem can then be hosted and shared on RubyGems.org. You can use the example codec implementation as a starting point. (If you’re unfamiliar with Ruby, you can find an excellent quickstart guide at [https://www.ruby-lang.org/en/documentation/quickstart/](https://www.ruby-lang.org/en/documentation/quickstart/).) + +## Get started [_get_started_2] + +Let’s step through creating a codec plugin using the [example codec plugin](https://github.com/logstash-plugins/logstash-codec-example/). + +### Create a GitHub repo for your new plugin [_create_a_github_repo_for_your_new_plugin_2] + +Each Logstash plugin lives in its own GitHub repository. To create a new repository for your plugin: + +1. Log in to GitHub. +2. Click the **Repositories** tab. You’ll see a list of other repositories you’ve forked or contributed to. +3. Click the green **New** button in the upper right. +4. Specify the following settings for your new repo: + + * **Repository name** — a unique name of the form `logstash-codec-pluginname`. + * **Public or Private** — your choice, but the repository must be Public if you want to submit it as an official plugin. + * **Initialize this repository with a README** — enables you to immediately clone the repository to your computer. + +5. Click **Create Repository**. + + +### Use the plugin generator tool [_use_the_plugin_generator_tool_2] + +You can create your own Logstash plugin in seconds! The `generate` subcommand of `bin/logstash-plugin` creates the foundation for a new Logstash plugin with templatized files. It creates the correct directory structure, gemspec files, and dependencies so you can start adding custom code to process data with Logstash. + +For more information, see [Generating plugins](/reference/plugin-generator.md) + + +### Copy the codec code [_copy_the_codec_code] + +Alternatively, you can use the examples repo we host on github.com + +1. **Clone your plugin.** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``codec-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash``-codec-MYPLUGINNAME.git` + + * `cd logstash-codec-MYPLUGINNAME` + +2. **Clone the codec plugin example and copy it to your plugin branch.** + + You don’t want to include the example .git directory or its contents, so delete it before you copy the example. + + * `cd /tmp` + * `git clone https://github.com/logstash-plugins/logstash``-codec-example.git` + * `cd logstash-codec-example` + * `rm -rf .git` + * `cp -R * /path/to/logstash-codec-mypluginname/` + +3. **Rename the following files to match the name of your plugin.** + + * `logstash-codec-example.gemspec` + * `example.rb` + * `example_spec.rb` + + ```txt + cd /path/to/logstash-codec-mypluginname + mv logstash-codec-example.gemspec logstash-codec-mypluginname.gemspec + mv lib/logstash/codecs/example.rb lib/logstash/codecs/mypluginname.rb + mv spec/codecs/example_spec.rb spec/codecs/mypluginname_spec.rb + ``` + + +Your file structure should look like this: + +```txt +$ tree logstash-codec-mypluginname +├── Gemfile +├── LICENSE +├── README.md +├── Rakefile +├── lib +│   └── logstash +│   └── codecs +│   └── mypluginname.rb +├── logstash-codec-mypluginname.gemspec +└── spec + └── codecs + └── mypluginname_spec.rb +``` + +For more information about the Ruby gem file structure and an excellent walkthrough of the Ruby gem creation process, see [http://timelessrepo.com/making-ruby-gems](http://timelessrepo.com/making-ruby-gems) + + +### See what your plugin looks like [_see_what_your_plugin_looks_like_2] + +Before we dive into the details, open up the plugin file in your favorite text editor and take a look. + +```ruby +require "logstash/codecs/base" +require "logstash/codecs/line" + +# Add any asciidoc formatted documentation here +class LogStash::Codecs::Example < LogStash::Codecs::Base + + # This example codec will append a string to the message field + # of an event, either in the decoding or encoding methods + # + # This is only intended to be used as an example. + # + # input { + # stdin { codec => example } + # } + # + # or + # + # output { + # stdout { codec => example } + # } + config_name "example" + + # Append a string to the message + config :append, :validate => :string, :default => ', Hello World!' + + public + def register + @lines = LogStash::Codecs::Line.new + @lines.charset = "UTF-8" + end + + public + def decode(data) + @lines.decode(data) do |line| + replace = { "message" => line["message"].to_s + @append } + yield LogStash::Event.new(replace) + end + end # def decode + + public + def encode(event) + @on_event.call(event, event.get("message").to_s + @append + NL) + end # def encode + +end # class LogStash::Codecs::Example +``` + + + +## Coding codec plugins [_coding_codec_plugins] + +Now let’s take a line-by-line look at the example plugin. + +### `require` Statements [_require_statements_2] + +Logstash codec plugins require parent classes defined in `logstash/codecs/base` and logstash/namespace: + +```ruby +require "logstash/codecs/base" +require "logstash/namespace" +``` + +Of course, the plugin you build may depend on other code, or even gems. Just put them here along with these Logstash dependencies. + + + +## Plugin Body [_plugin_body_2] + +Let’s go through the various elements of the plugin itself. + +### `class` Declaration [_class_declaration_2] + +The codec plugin class should be a subclass of `LogStash::Codecs::Base`: + +```ruby +class LogStash::Codecs::Example < LogStash::Codecs::Base +``` + +The class name should closely mirror the plugin name, for example: + +```ruby +LogStash::Codecs::Example +``` + + +### `config_name` [_config_name_2] + +```ruby + config_name "example" +``` + +This is the name your plugin will call inside the codec configuration block. + +If you set `config_name "example"` in your plugin code, the corresponding Logstash configuration block would need to look like this: + + + +## Configuration Parameters [_configuration_parameters_2] + +```ruby + config :variable_name, :validate => :variable_type, :default => "Default value", :required => boolean, :deprecated => boolean, :obsolete => string +``` + +The configuration, or `config` section allows you to define as many (or as few) parameters as are needed to enable Logstash to process events. + +There are several configuration attributes: + +* `:validate` - allows you to enforce passing a particular data type to Logstash for this configuration option, such as `:string`, `:password`, `:boolean`, `:number`, `:array`, `:hash`, `:path` (a file-system path), `uri`, `:codec` (since 1.2.0), `:bytes`. Note that this also works as a coercion in that if I specify "true" for boolean (even though technically a string), it will become a valid boolean in the config. This coercion works for the `:number` type as well where "1.2" becomes a float and "22" is an integer. +* `:default` - lets you specify a default value for a parameter +* `:required` - whether or not this parameter is mandatory (a Boolean `true` or +* `:list` - whether or not this value should be a list of values. Will typecheck the list members, and convert scalars to one element lists. Note that this mostly obviates the array type, though if you need lists of complex objects that will be more suitable. `false`) +* `:deprecated` - informational (also a Boolean `true` or `false`) +* `:obsolete` - used to declare that a given setting has been removed and is no longer functioning. The idea is to provide an informed upgrade path to users who are still using a now-removed setting. + + +## Plugin Methods [_plugin_methods_2] + +Logstash codecs must implement the `register` method, and the `decode` method or the `encode` method (or both). + +### `register` Method [_register_method_2] + +```ruby + public + def register + end # def register +``` + +The Logstash `register` method is like an `initialize` method. It was originally created to enforce having `super` called, preventing headaches for newbies. (Note: It may go away in favor of `initialize`, in conjunction with some enforced testing to ensure `super` is called.) + +`public` means the method can be called anywhere, not just within the class. This is the default behavior for methods in Ruby, but it is specified explicitly here anyway. + +You can also assign instance variables here (variables prepended by `@`). Configuration variables are now in scope as instance variables, like `@message` + + +### `decode` Method [_decode_method] + +```ruby + public + def decode(data) + @lines.decode(data) do |line| + replace = { "message" => line["message"].to_s + @append } + yield LogStash::Event.new(replace) + end + end # def decode +``` + +The codec’s `decode` method is where data coming in from an input is transformed into an event. There are complex examples like the [collectd](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/lib/logstash/codecs/collectd.rb#L386-L484) codec, and simpler examples like the [spool](https://github.com/logstash-plugins/logstash-codec-spool/blob/main/lib/logstash/codecs/spool.rb#L11-L16) codec. + +There must be a `yield` statement as part of the `decode` method which will return decoded events to the pipeline. + + +### `encode` Method [_encode_method] + +```ruby + public + def encode(event) + @on_event.call(event, event.get("message").to_s + @append + NL) + end # def encode +``` + +The `encode` method takes an event and serializes it (*encodes*) into another format. Good examples of `encode` methods include the simple [plain](https://github.com/logstash-plugins/logstash-codec-plain/blob/main/lib/logstash/codecs/plain.rb#L39-L46) codec, the slightly more involved [msgpack](https://github.com/logstash-plugins/logstash-codec-msgpack/blob/main/lib/logstash/codecs/msgpack.rb#L38-L46) codec, and even an [avro](https://github.com/logstash-plugins/logstash-codec-avro/blob/main/lib/logstash/codecs/avro.rb#L38-L45) codec. + +In most cases, your `encode` method should have an `@on_event.call()` statement. This call will output data per event in the described way. + + + +## Building the Plugin [_building_the_plugin_2] + +At this point in the process you have coded your plugin and are ready to build a Ruby Gem from it. The following information will help you complete the process. + +### External dependencies [_external_dependencies_2] + +A `require` statement in Ruby is used to include necessary code. In some cases your plugin may require additional files. For example, the collectd plugin [uses](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/lib/logstash/codecs/collectd.rb#L148) the `types.db` file provided by collectd. In the main directory of your plugin, a file called `vendor.json` is where these files are described. + +The `vendor.json` file contains an array of JSON objects, each describing a file dependency. This example comes from the [collectd](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/vendor.json) codec plugin: + +```txt +[{ + "sha1": "a90fe6cc53b76b7bdd56dc57950d90787cb9c96e", + "url": "http://collectd.org/files/collectd-5.4.0.tar.gz", + "files": [ "/src/types.db" ] +}] +``` + +* `sha1` is the sha1 signature used to verify the integrity of the file referenced by `url`. +* `url` is the address from where Logstash will download the file. +* `files` is an optional array of files to extract from the downloaded file. Note that while tar archives can use absolute or relative paths, treat them as absolute in this array. If `files` is not present, all files will be uncompressed and extracted into the vendor directory. + +Another example of the `vendor.json` file is the [`geoip` filter](https://github.com/logstash-plugins/logstash-filter-geoip/blob/main/vendor.json) + +The process used to download these dependencies is to call `rake vendor`. This will be discussed further in the testing section of this document. + +Another kind of external dependency is on jar files. This will be described in the "Add a `gemspec` file" section. + + +### Deprecated features [_deprecated_features_2] + +As a plugin evolves, an option or feature may no longer serve the intended purpose, and the developer may want to *deprecate* its usage. Deprecation warns users about the option’s status, so they aren’t caught by surprise when it is removed in a later release. + +{{ls}} 7.6 introduced a *deprecation logger* to make handling those situations easier. You can use the [adapter](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support) to ensure that your plugin can use the deprecation logger while still supporting older versions of {{ls}}. See the [readme](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support/blob/main/README.md) for more information and for instructions on using the adapter. + +Deprecations are noted in the `logstash-deprecation.log` file in the `log` directory. + + +### Add a Gemfile [_add_a_gemfile_2] + +Gemfiles allow Ruby’s Bundler to maintain the dependencies for your plugin. Currently, all we’ll need is the Logstash gem, for testing, but if you require other gems, you should add them in here. + +::::{tip} +See [Bundler’s Gemfile page](http://bundler.io/gemfile.html) for more details. +:::: + + +```ruby +source 'https://rubygems.org' +gemspec +gem "logstash", :github => "elastic/logstash", :branch => "master" +``` + + + +## Add a `gemspec` file [_add_a_gemspec_file_2] + +Gemspecs define the Ruby gem which will be built and contain your plugin. + +::::{tip} +More information can be found on the [Rubygems Specification page](http://guides.rubygems.org/specification-reference/). +:::: + + +```ruby +Gem::Specification.new do |s| + s.name = 'logstash-codec-example' + s.version = '0.1.0' + s.licenses = ['Apache License (2.0)'] + s.summary = "This codec does x, y, z in Logstash" + s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" + s.authors = ["Elastic"] + s.email = 'info@elastic.co' + s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" + s.require_paths = ["lib"] + + # Files + s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT'] + # Tests + s.test_files = s.files.grep(%r{^(test|spec|features)/}) + + # Special flag to let us know this is actually a logstash plugin + s.metadata = { "logstash_plugin" => "true", "logstash_group" => "codec" } + + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +end +``` + +It is appropriate to change these values to fit your plugin. In particular, `s.name` and `s.summary` should reflect your plugin’s name and behavior. + +`s.licenses` and `s.version` are also important and will come into play when you are ready to publish your plugin. + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elastic/logstash/blob/main/LICENSE.txt). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + +The gem version, designated by `s.version`, helps track changes to plugins over time. You should use [semver versioning](http://semver.org/) strategy for version numbers. + +### Runtime and Development Dependencies [_runtime_and_development_dependencies_2] + +At the bottom of the `gemspec` file is a section with a comment: `Gem dependencies`. This is where any other needed gems must be mentioned. If a gem is necessary for your plugin to function, it is a runtime dependency. If a gem are only used for testing, then it would be a development dependency. + +::::{note} +You can also have versioning requirements for your dependencies—​including other Logstash plugins: + +```ruby + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +``` + +This gemspec has a runtime dependency on the logstash-core-plugin-api and requires that it have a version number greater than or equal to version 1.60 and less than or equal to version 2.99. + +:::: + + +::::{important} +All plugins have a runtime dependency on the `logstash-core-plugin-api` gem, and a development dependency on `logstash-devutils`. +:::: + + + +### Jar dependencies [_jar_dependencies_2] + +In some cases, such as the [Elasticsearch output plugin](https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/main/logstash-output-elasticsearch.gemspec#L22-L23), your code may depend on a jar file. In cases such as this, the dependency is added in the gemspec file in this manner: + +```ruby + # Jar dependencies + s.requirements << "jar 'org.elasticsearch:elasticsearch', '5.0.0'" + s.add_runtime_dependency 'jar-dependencies' +``` + +With these both defined, the install process will search for the required jar file at [http://mvnrepository.com](http://mvnrepository.com) and download the specified version. + + + +## Document your plugin [_document_your_plugin_2] + +Documentation is an important part of your plugin. All plugin documentation is rendered and placed in the [Logstash Reference](/reference/index.md) and the [Versioned plugin docs](logstash-docs-md://vpr/integration-plugins.md). + +See [Document your plugin](/extend/plugin-doc.md) for tips and guidelines. + + +## Add Tests [_add_tests_2] + +Logstash loves tests. Lots of tests. If you’re using your new codec plugin in a production environment, you’ll want to have some tests to ensure you are not breaking any existing functionality. + +::::{note} +A full exposition on RSpec is outside the scope of this document. Learn more about RSpec at [http://rspec.info](http://rspec.info) +:::: + + +For help learning about tests and testing, look in the `spec/codecs/` directory of several other similar plugins. + + +## Clone and test! [_clone_and_test_2] + +Now let’s start with a fresh clone of the plugin, build it and run the tests. + +* **Clone your plugin into a temporary location** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``codec-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash-``codec-MYPLUGINNAME.git` + + * `cd logstash-codec-MYPLUGINNAME` + + +Then, you’ll need to install your plugins dependencies with bundler: + +``` +bundle install +``` + +::::{important} +If your plugin has an external file dependency described in `vendor.json`, you must download that dependency before running or testing. You can do this by running: + +``` +rake vendor +``` + +:::: + + +And finally, run the tests: + +``` +bundle exec rspec +``` + +You should see a success message, which looks something like this: + +``` +Finished in 0.034 seconds +1 example, 0 failures +``` + +Hooray! You’re almost there! (Unless you saw failures…​ you should fix those first). + + +## Building and Testing [_building_and_testing_2] + +Now you’re ready to build your (well-tested) plugin into a Ruby gem. + +### Build [_build_2] + +You already have all the necessary ingredients, so let’s go ahead and run the build command: + +```sh +gem build logstash-codec-example.gemspec +``` + +That’s it! Your gem should be built and be in the same path with the name + +```sh +logstash-codec-mypluginname-0.1.0.gem +``` + +The `s.version` number from your gemspec file will provide the gem version, in this case, `0.1.0`. + + +### Test installation [_test_installation_2] + +You should test install your plugin into a clean installation of Logstash. Download the latest version from the [Logstash downloads page](https://www.elastic.co/downloads/logstash/). + +1. Untar and cd in to the directory: + + ```sh + curl -O https://download.elastic.co/logstash/logstash/logstash-9.0.0.tar.gz + tar xzvf logstash-9.0.0.tar.gz + cd logstash-9.0.0 + ``` + +2. Using the plugin tool, we can install the gem we just built. + + * Replace `/my/logstash/plugins` with the correct path to the gem for your environment, and `0.1.0` with the correct version number from the gemspec file. + + ```sh + bin/logstash-plugin install /my/logstash/plugins/logstash-codec-example/logstash-codec-example-0.1.0.gem + ``` + + * After running this, you should see feedback from Logstash that it was successfully installed: + + ```sh + validating /my/logstash/plugins/logstash-codec-example/logstash-codec-example-0.1.0.gem >= 0 + Valid logstash plugin. Continuing... + Successfully installed 'logstash-codec-example' with version '0.1.0' + ``` + + ::::{tip} + You can also use the Logstash plugin tool to determine which plugins are currently available: + + ```sh + bin/logstash-plugin list + ``` + + Depending on what you have installed, you might see a short or long list of plugins: inputs, codecs, filters and outputs. + + :::: + +3. Now try running Logstash with a simple configuration passed in via the command-line, using the `-e` flag. + + ::::{note} + Your results will depend on what your codec plugin is designed to do. + :::: + + +```sh +bin/logstash -e 'input { stdin{ codec => example{}} } output {stdout { codec => rubydebug }}' +``` + +The example codec plugin will append the contents of `append` (which by default appends ", Hello World!") + +After starting Logstash, type something, for example "Random output string". The resulting output message field contents should be, "Random output string, Hello World!": + +```sh +Random output string +{ + "message" => "Random output string, Hello World!", + "@version" => "1", + "@timestamp" => "2015-01-27T19:17:18.932Z", + "host" => "cadenza" +} +``` + +Feel free to experiment and test this by changing the `append` parameter: + +```sh +bin/logstash -e 'input { stdin{ codec => example{ append => ", I am appending this! }} } output {stdout { codec => rubydebug }}' +``` + +Congratulations! You’ve built, deployed and successfully run a Logstash codec. + + + +## Submitting your plugin to [RubyGems.org](http://rubygems.org) and [logstash-plugins](https://github.com/logstash-plugins) [_submitting_your_plugin_to_rubygems_orghttprubygems_org_and_logstash_pluginshttpsgithub_comlogstash_plugins_2] + +Logstash uses [RubyGems.org](http://rubygems.org) as its repository for all plugin artifacts. Once you have developed your new plugin, you can make it available to Logstash users by simply publishing it to RubyGems.org. + +### Licensing [_licensing_2] + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elasticsearch/logstash/blob/main/LICENSE). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + + +### Publishing to [RubyGems.org](http://rubygems.org) [_publishing_to_rubygems_orghttprubygems_org_2] + +To begin, you’ll need an account on RubyGems.org + +* [Sign-up for a RubyGems account](https://rubygems.org/sign_up). + +After creating an account, [obtain](http://guides.rubygems.org/rubygems-org-api/#api-authorization) an API key from RubyGems.org. By default, RubyGems uses the file `~/.gem/credentials` to store your API key. These credentials will be used to publish the gem. Replace `username` and `password` with the credentials you created at RubyGems.org: + +```sh +curl -u username:password https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials +chmod 0600 ~/.gem/credentials +``` + +Before proceeding, make sure you have the right version in your gemspec file and commit your changes. + +* `s.version = '0.1.0'` + +To publish version 0.1.0 of your new logstash gem: + +```sh +bundle install +bundle exec rake vendor +bundle exec rspec +bundle exec rake publish_gem +``` + +::::{note} +Executing `rake publish_gem`: + +1. Reads the version from the gemspec file (`s.version = '0.1.0'`) +2. Checks in your local repository if a tag exists for that version. If the tag already exists, it aborts the process. Otherwise, it creates a new version tag in your local repository. +3. Builds the gem +4. Publishes the gem to RubyGems.org + +:::: + + +That’s it! Your plugin is published! Logstash users can now install your plugin by running: + +```sh +bin/logstash-plugin install logstash-codec-mypluginname +``` + + + +## Contributing your source code to [logstash-plugins](https://github.com/logstash-plugins) [_contributing_your_source_code_to_logstash_pluginshttpsgithub_comlogstash_plugins_2] + +It is not required to contribute your source code to [logstash-plugins](https://github.com/logstash-plugins) github organization, but we always welcome new plugins! + +### Benefits [_benefits_2] + +Some of the many benefits of having your plugin in the logstash-plugins repository are: + +* **Discovery.** Your plugin will appear in the [Logstash Reference](/reference/index.md), where Logstash users look first for plugins and documentation. +* **Documentation.** Your plugin documentation will automatically be added to the [Logstash Reference](/reference/index.md). +* **Testing.** With our testing infrastructure, your plugin will be continuously tested against current and future releases of Logstash. As a result, users will have the assurance that if incompatibilities arise, they will be quickly discovered and corrected. + + +### Acceptance Guidelines [_acceptance_guidelines_2] + +* **Code Review.** Your plugin must be reviewed by members of the community for coherence, quality, readability, stability and security. +* **Tests.** Your plugin must contain tests to be accepted. These tests are also subject to code review for scope and completeness. It’s ok if you don’t know how to write tests — we will guide you. We are working on publishing a guide to creating tests for Logstash which will make it easier. In the meantime, you can refer to [http://betterspecs.org/](http://betterspecs.org/) for examples. + +To begin migrating your plugin to logstash-plugins, simply create a new [issue](https://github.com/elasticsearch/logstash/issues) in the Logstash repository. When the acceptance guidelines are completed, we will facilitate the move to the logstash-plugins organization using the recommended [github process](https://help.github.com/articles/transferring-a-repository/#transferring-from-a-user-to-an-organization). diff --git a/docs/extend/community-maintainer.md b/docs/extend/community-maintainer.md new file mode 100644 index 000000000..686d0012c --- /dev/null +++ b/docs/extend/community-maintainer.md @@ -0,0 +1,193 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/community-maintainer.html +--- + +# Logstash Plugins Community Maintainer Guide [community-maintainer] + +This document, to be read by new Maintainers, should explain their responsibilities. It was inspired by the [C4](http://rfc.zeromq.org/spec:22) document from the ZeroMQ project. This document is subject to change and suggestions through Pull Requests and issues are strongly encouraged. + + +## Contribution Guidelines [_contribution_guidelines] + +For general guidance around contributing to Logstash Plugins, see the [*Contributing to Logstash*](/extend/index.md) section. + + +## Document Goals [_document_goals] + +To help make the Logstash plugins community participation easy with positive feedback. + +To increase diversity. + +To reduce code review, merge and release dependencies on the core team by providing support and tools to the Community and Maintainers. + +To support the natural life cycle of a plugin. + +To codify the roles and responsibilities of: Maintainers and Contributors with specific focus on patch testing, code review, merging and release. + + +## Development Workflow [_development_workflow] + +All Issues and Pull Requests must be tracked using the Github issue tracker. + +The plugin uses the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0). Maintainers should check whether a patch introduces code which has an incompatible license. Patch ownership and copyright is defined in the Elastic [Contributor License Agreement](https://www.elastic.co/contributor-agreement) (CLA). + + +### Terminology [_terminology_2] + +A "Contributor" is a role a person assumes when providing a patch. Contributors will not have commit access to the repository. They need to sign the Elastic [Contributor License Agreement](https://www.elastic.co/contributor-agreement) before a patch can be reviewed. Contributors can add themselves to the plugin Contributor list. + +A "Maintainer" is a role a person assumes when maintaining a plugin and keeping it healthy, including triaging issues, and reviewing and merging patches. + + +### Patch Requirements [_patch_requirements] + +A patch is a minimal and accurate answer to exactly one identified and agreed upon problem. It must conform to the [code style guidelines](https://github.com/elastic/logstash/blob/main/STYLE.md) and must include RSpec tests that verify the fitness of the solution. + +A patch will be automatically tested by a CI system that will report on the Pull Request status. + +A patch CLA will be automatically verified and reported on the Pull Request status. + +A patch commit message has a single short (less than 50 character) first line summarizing the change, a blank second line, and any additional lines as necessary for change explanation and rationale. + +A patch is mergeable when it satisfies the above requirements and has been reviewed positively by at least one other person. + + +### Development Process [_development_process] + +A user will log an issue on the issue tracker describing the problem they face or observe with as much detail as possible. + +To work on an issue, a Contributor forks the plugin repository and then works on their forked repository and submits a patch by creating a pull request back to the plugin. + +Maintainers must not merge patches where the author has not signed the CLA. + +Before a patch can be accepted it should be reviewed. Maintainers should merge accepted patches without delay. + +Maintainers should not merge their own patches except in exceptional cases, such as non-responsiveness from other Maintainers or core team for an extended period (more than 2 weeks). + +Reviewer’s comments should not be based on personal preferences. + +The Maintainers should label Issues and Pull Requests. + +Maintainers should involve the core team if help is needed to reach consensus. + +Review non-source changes such as documentation in the same way as source code changes. + + +### Branch Management [_branch_management] + +The plugin has a main branch that always holds the latest in-progress version and should always build. Topic branches should kept to the minimum. + + +### Changelog Management [_changelog_management] + +Every plugin should have a changelog (https://www.elastic.co/guide/en/logstash/current/CHANGELOG.html). If not, please create one. When changes are made to a plugin, make sure to include a changelog entry under the respective version to document the change. The changelog should be easily understood from a user point of view. As we iterate and release plugins rapidly, users use the changelog as a mechanism for deciding whether to update. + +Changes that are not user facing should be tagged as `internal:`. For example: + +```markdown + - internal: Refactored specs for better testing + - config: Default timeout configuration changed from 10s to 5s +``` + + +#### Detailed format of https://www.elastic.co/guide/en/logstash/current/CHANGELOG.html [_detailed_format_of_changelog_md] + +Sharing a similar format of https://www.elastic.co/guide/en/logstash/current/CHANGELOG.html in plugins ease readability for users. Please see following annotated example and see a concrete example in [logstash-filter-date](https://raw.githubusercontent.com/logstash-plugins/logstash-filter-date/main/https://www.elastic.co/guide/en/logstash/current/CHANGELOG.html). + +```markdown +## 1.0.x <1> + - change description <2> + - tag: change description <3> + - tag1,tag2: change description <4> + - tag: Multi-line description <5> + must be indented and can use + additional markdown syntax + <6> +## 1.0.0 <7> +[...] +``` + +1. Latest version is the first line of https://www.elastic.co/guide/en/logstash/current/CHANGELOG.html. Each version identifier should be a level-2 header using `##` +2. One change description is described as a list item using a dash `-` aligned under the version identifier +3. One change can be tagged by a word and suffixed by `:`.
Common tags are `bugfix`, `feature`, `doc`, `test` or `internal`. +4. One change can have multiple tags separated by a comma and suffixed by `:` +5. A multi-line change description must be properly indented +6. Please take care to **separate versions with an empty line** +7. Previous version identifier + + + +### Continuous Integration [_continuous_integration] + +Plugins are setup with automated continuous integration (CI) environments and there should be a corresponding badge on each Github page. If it’s missing, please contact the Logstash core team. + +Every Pull Request opened automatically triggers a CI run. To conduct a manual run, comment “Jenkins, please test this.” on the Pull Request. + + +## Versioning Plugins [_versioning_plugins] + +Logstash core and its plugins have separate product development lifecycles. Hence the versioning and release strategy for the core and plugins do not have to be aligned. In fact, this was one of our goals during the great separation of plugins work in Logstash 1.5. + +At times, there will be changes in core API in Logstash, which will require mass update of plugins to reflect the changes in core. However, this does not happen frequently. + +For plugins, we would like to adhere to a versioning and release strategy that can better inform our users, about any breaking changes to the Logstash configuration formats and functionality. + +Plugin releases follows a three-placed numbering scheme X.Y.Z. where X denotes a major release version which may break compatibility with existing configuration or functionality. Y denotes releases which includes features which are backward compatible. Z denotes releases which includes bug fixes and patches. + + +### Changing the version [_changing_the_version] + +Version can be changed in the Gemspec, which needs to be associated with a changelog entry. Following this, we can publish the gem to RubyGem.org manually. At this point only the core developers can publish a gem. + + +### Labeling [_labeling] + +Labeling is a critical aspect of maintaining plugins. All issues in GitHub should be labeled correctly so it can: + +* Provide good feedback to users/developers +* Help prioritize changes +* Be used in release notes + +Most labels are self explanatory, but here’s a quick recap of few important labels: + +* `bug`: Labels an issue as an unintentional defect +* `needs details`: If a the issue reporter has incomplete details, please ask them for more info and label as needs details. +* `missing cla`: Contributor License Agreement is missing and patch cannot be accepted without it +* `adopt me`: Ask for help from the community to take over this issue +* `enhancement`: New feature, not a bug fix +* `needs tests`: Patch has no tests, and cannot be accepted without unit/integration tests +* `docs`: Documentation related issue/PR + + +## Logging [_logging] + +Although it’s important not to bog down performance with excessive logging, debug level logs can be immensely helpful when diagnosing and troubleshooting issues with Logstash. Please remember to liberally add debug logs wherever it makes sense as users will be forever gracious. + +```shell +@logger.debug("Logstash loves debug logs!", :actions => actions) +``` + + +## Contributor License Agreement (CLA) Guidance [_contributor_license_agreement_cla_guidance] + +Why is a [CLA](https://www.elastic.co/contributor-agreement) required? +: We ask this of all Contributors in order to assure our users of the origin and continuing existence of the code. We are not asking Contributors to assign copyright to us, but to give us the right to distribute a Contributor’s code without restriction. + +Please make sure the CLA is signed by every Contributor prior to reviewing PRs and commits. +: Contributors only need to sign the CLA once and should sign with the same email as used in Github. If a Contributor signs the CLA after a PR is submitted, they can refresh the automated CLA checker by pushing another comment on the PR after 5 minutes of signing. + + +## Need Help? [_need_help] + +Ping @logstash-core on Github to get the attention of the Logstash core team. + + +## Community Administration [_community_administration] + +The core team is there to support the plugin Maintainers and overall ecosystem. + +Maintainers should propose Contributors to become a Maintainer. + +Contributors and Maintainers should follow the Elastic Community [Code of Conduct](https://www.elastic.co/community/codeofconduct). The core team should block or ban "bad actors". + diff --git a/docs/extend/contribute-to-core.md b/docs/extend/contribute-to-core.md new file mode 100644 index 000000000..fbc7043ca --- /dev/null +++ b/docs/extend/contribute-to-core.md @@ -0,0 +1,11 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/contribute-to-core.html +--- + +# Extending Logstash core [contribute-to-core] + +We also welcome contributions and bug fixes to the Logstash core feature set. + +Please read through our [contribution](https://github.com/elastic/logstash/blob/main/CONTRIBUTING.md) guide, and the Logstash [readme](https://github.com/elastic/logstash/blob/main/README.md) document. + diff --git a/docs/extend/contributing-patch-plugin.md b/docs/extend/contributing-patch-plugin.md new file mode 100644 index 000000000..a1621fd56 --- /dev/null +++ b/docs/extend/contributing-patch-plugin.md @@ -0,0 +1,386 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/contributing-patch-plugin.html +--- + +# Contributing a patch to a Logstash plugin [contributing-patch-plugin] + +This section discusses the information you need to know to successfully contribute a patch to a Logstash plugin. + +Each plugin defines its own configuration options. These control the behavior of the plugin to some degree. Configuration option definitions commonly include: + +* Data validation +* Default value +* Any required flags + +Plugins are subclasses of a Logstash base class. A plugin’s base class defines common configuration and methods. + +## Input plugins [contrib-patch-input] + +Input plugins ingest data from an external source. Input plugins are always associated with a codec. An input plugin always has an associated codec plugin. Input and codec plugins operate in conjunction to create a Logstash event and add that event to the processing queue. An input codec is a subclass of the `LogStash::Inputs::Base` class. + +### Input API [input-api] + +`#register() -> nil` +: Required. This API sets up resources for the plugin, typically the connection to the external source. + +`#run(queue) -> nil` +: Required. This API fetches or listens for source data, typically looping until stopped. Must handle errors inside the loop. Pushes any created events to the queue object specified in the method argument. Some inputs may receive batched data to minimize the external call overhead. + +`#stop() -> nil` +: Optional. Stops external connections and cleans up. + + + +## Codec plugins [contrib-patch-codec] + +Codec plugins decode input data that has a specific structure, such as JSON input data. A codec plugin is a subclass of `LogStash::Codecs::Base`. + +### Codec API [codec-api] + +`#register() -> nil` +: Identical to the API of the same name for input plugins. + +`#decode(data){|event| block} -> nil` +: Must be implemented. Used to create an Event from the raw data given in the method argument. Must handle errors. The caller must provide a Ruby block. The block is called with the created Event. + +`#encode(event) -> nil` +: Required. Used to create a structured data object from the given Event. May handle errors. This method calls a block that was previously stored as @on_event with two arguments: the original event and the data object. + + + +## Filter plugins [contrib-patch-filter] + +A mechanism to change, mutate or merge one or more Events. A filter plugin is a subclass of the `LogStash::Filters::Base` class. + +### Filter API [filter-api] + +`#register() -> nil` +: Identical to the API of the same name for input plugins. + +`#filter(event) -> nil` +: Required. May handle errors. Used to apply a mutation function to the given event. + + + +## Output plugins [contrib-patch-output] + +A mechanism to send an event to an external destination. This process may require serialization. An output plugin is a subclass of the `LogStash::Outputs::Base` class. + +### Output API [output-api] + +`#register() -> nil` +: Identical to the API of the same name for input plugins. + +`#receive(event) -> nil` +: Required. Must handle errors. Used to prepare the given event for transmission to the external destination. Some outputs may buffer the prepared events to batch transmit to the destination. + + + +## Process [patch-process] + +A bug or feature is identified. An issue is created in the plugin repository. A patch is created and a pull request (PR) is submitted. After review and possible rework the PR is merged and the plugin is published. + +The [Community Maintainer Guide](/extend/community-maintainer.md) explains, in more detail, the process of getting a patch accepted, merged and published. The Community Maintainer Guide also details the roles that contributors and maintainers are expected to perform. + + +## Testing methodologies [test-methods] + +### Test driven development [tdd] + +Test driven development (TDD) describes a methodology for using tests to guide evolution of source code. For our purposes, we are use only a part of it. Before writing the fix, we create tests that illustrate the bug by failing. We stop when we have written enough code to make the tests pass and submit the fix and tests as a patch. It is not necessary to write the tests before the fix, but it is very easy to write a passing test afterwards that may not actually verify that the fault is really fixed especially if the fault can be triggered via multiple execution paths or varying input data. + + +### RSpec framework [rspec] + +Logstash uses Rspec, a Ruby testing framework, to define and run the test suite. What follows is a summary of various sources. + +```ruby + 2 require "logstash/devutils/rspec/spec_helper" + 3 require "logstash/plugin" + 4 + 5 describe "outputs/riemann" do + 6 describe "#register" do + 7 let(:output) do + 8 LogStash::Plugin.lookup("output", "riemann").new(configuration) + 9 end +10 +11 context "when no protocol is specified" do +12 let(:configuration) { Hash.new } +13 +14 it "the method completes without error" do +15 expect {output.register}.not_to raise_error +16 end +17 end +18 +19 context "when a bad protocol is specified" do +20 let(:configuration) { {"protocol" => "fake"} } +21 +22 it "the method fails with error" do +23 expect {output.register}.to raise_error +24 end +25 end +26 +27 context "when the tcp protocol is specified" do +28 let(:configuration) { {"protocol" => "tcp"} } +29 +30 it "the method completes without error" do +31 expect {output.register}.not_to raise_error +32 end +33 end +34 end +35 +36 describe "#receive" do +37 let(:output) do +38 LogStash::Plugin.lookup("output", "riemann").new(configuration) +39 end +40 +41 context "when operating normally" do +42 let(:configuration) { Hash.new } +43 let(:event) do +44 data = {"message"=>"hello", "@version"=>"1", +45 "@timestamp"=>"2015-06-03T23:34:54.076Z", +46 "host"=>"vagrant-ubuntu-trusty-64"} +47 LogStash::Event.new(data) +48 end +49 +50 before(:example) do +51 output.register +52 end +53 +54 it "should accept the event" do +55 expect { output.receive event }.not_to raise_error +56 end +57 end +58 end +59 end +``` + +```ruby +describe(string){block} -> nil +describe(Class){block} -> nil +``` + +With RSpec, we are always describing the plugin method behavior. The describe block is added in logical sections and can accept either an existing class name or a string. The string used in line 5 is the plugin name. Line 6 is the register method, line 36 is the receive method. It is a RSpec convention to prefix instance methods with one hash and class methods with one dot. + +```ruby +context(string){block} -> nil +``` + +In RSpec, context blocks define sections that group tests by a variation. The string should start with the word `when` and then detail the variation. See line 11. The tests in the content block should should only be for that variation. + +```ruby +let(symbol){block} -> nil +``` + +In RSpec, `let` blocks define resources for use in the test blocks. These resources are reinitialized for every test block. They are available as method calls inside the test block. Define `let` blocks in `describe` and `context` blocks, which scope the `let` block and any other nested blocks. You can use other `let` methods defined later within the `let` block body. See lines 7-9, which define the output resource and use the configuration method, defined with different variations in lines 12, 20 and 28. + +```ruby +before(symbol){block} -> nil - symbol is one of :suite, :context, :example, but :all and :each are synonyms for :suite and :example respectively. +``` + +In RSpec, `before` blocks are used to further set up any resources that would have been initialized in a `let` block. You cannot define `let` blocks inside `before` blocks. + +You can also define `after` blocks, which are typically used to clean up any setup activity performed by a `before` block. + +```ruby +it(string){block} -> nil +``` + +In RSpec, `it` blocks set the expectations that verify the behavior of the tested code. The string should not start with *it* or *should*, but needs to express the outcome of the expectation. When put together the texts from the enclosing describe, `context` and `it` blocks should form a fairly readable sentence, as in lines 5, 6, 11 and 14: + +```ruby +outputs/riemann +#register when no protocol is specified the method completes without error +``` + +Readable code like this make the goals of tests easy to understand. + +```ruby +expect(object){block} -> nil +``` + +In RSpec, the expect method verifies a statement that compares an actual result to an expected result. The `expect` method is usually paired with a call to the `to` or `not_to` methods. Use the block form when expecting errors or observing for changes. The `to` or `not_to` methods require a `matcher` object that encapsulates the expected value. The argument form of the `expect` method encapsulates the actual value. When put together the whole line tests the actual against the expected value. + +```ruby +raise_error(error class|nil) -> matcher instance +be(object) -> matcher instance +eq(object) -> matcher instance +eql(object) -> matcher instance + for more see http://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers +``` + +In RSpec, a matcher is an object generated by the equivalent method call (be, eq) that will be used to evaluate the expected against the actual values. + + + +## Putting it all together [all-together] + +This example fixes an [issue](https://github.com/logstash-plugins/logstash-output-zeromq/issues/9) in the ZeroMQ output plugin. The issue does not require knowledge of ZeroMQ. + +The activities in this example have the following prerequisites: + +* A minimal knowledge of Git and Github. See the [Github boot camp](https://help.github.com/categories/bootcamp/). +* A text editor. +* A JRuby [runtime](https://www.ruby-lang.org/en/documentation/installation/#managers) [environment](https://howistart.org/posts/ruby/1). The `chruby` tool manages Ruby versions. +* JRuby 1.7.22 or later. +* The `bundler` and `rake` gems installed. +* ZeroMQ [installed](http://zeromq.org/intro:get-the-software). + +1. In Github, fork the ZeroMQ [output plugin repository](https://github.com/logstash-plugins/logstash-output-zeromq). +2. On your local machine, [clone](https://help.github.com/articles/fork-a-repo/) the fork to a known folder such as `logstash/`. +3. Open the following files in a text editor: + + * `logstash-output-zeromq/lib/logstash/outputs/zeromq.rb` + * `logstash-output-zeromq/lib/logstash/util/zeromq.rb` + * `logstash-output-zeromq/spec/outputs/zeromq_spec.rb` + +4. According to the issue, log output in server mode must indicate `bound`. Furthermore, the test file contains no tests. + + ::::{note} + Line 21 of `util/zeromq.rb` reads `@logger.info("0mq: #{server? ? 'connected' : 'bound'}", :address => address)` + :::: + +5. In the text editor, require `zeromq.rb` for the file `zeromq_spec.rb` by adding the following lines: + + ```ruby + require "logstash/outputs/zeromq" + require "logstash/devutils/rspec/spec_helper" + ``` + +6. The desired error message should read: + + ```ruby + LogStash::Outputs::ZeroMQ when in server mode a 'bound' info line is logged + ``` + + To properly generate this message, add a `describe` block with the fully qualified class name as the argument, a context block, and an `it` block. + + ```ruby + describe LogStash::Outputs::ZeroMQ do + context "when in server mode" do + it "a 'bound' info line is logged" do + end + end + end + ``` + +7. To add the missing test, use an instance of the ZeroMQ output and a substitute logger. This example uses an RSpec feature called *test doubles* as the substitute logger. + + Add the following lines to `zeromq_spec.rb`, after `describe LogStash::Outputs::ZeroMQ do` and before `context "when in server mode" do`: + + ```ruby + let(:output) { described_class.new("mode" => "server", "topology" => "pushpull" } + let(:tracer) { double("logger") } + ``` + +8. Add the body to the `it` block. Add the following five lines after the line `context "when in server mode" do`: + + ```ruby + allow(tracer).to receive(:debug)<1> + output.logger = logger<2> + expect(tracer).to receive(:info).with("0mq: bound", {:address=>"tcp://127.0.0.1:2120"})<3> + output.register<4> + output.do_close<5> + ``` + + +1. Allow the double to receive `debug` method calls. +2. Make the output use the test double. +3. Set an expectation on the test to receive an `info` method call. +4. Call `register` on the output. +5. Call `do_close` on the output so the test does not hang. + + +At the end of the modifications, the relevant code section reads: + +```ruby +require "logstash/outputs/zeromq" +require "logstash/devutils/rspec/spec_helper" + +describe LogStash::Outputs::ZeroMQ do + let(:output) { described_class.new("mode" => "server", "topology" => "pushpull") } + let(:tracer) { double("logger") } + + context "when in server mode" do + it "a ‘bound’ info line is logged" do + allow(tracer).to receive(:debug) + output.logger = tracer + expect(tracer).to receive(:info).with("0mq: bound", {:address=>"tcp://127.0.0.1:2120"}) + output.register + output.do_close + end + end +end +``` + +To run this test: + +1. Open a terminal window +2. Navigate to the cloned plugin folder +3. The first time you run the test, run the command `bundle install` +4. Run the command `bundle exec rspec` + +Assuming all prerequisites were installed correctly, the test fails with output similar to: + +```shell +Using Accessor#strict_set for specs +Run options: exclude {:redis=>true, :socket=>true, :performance=>true, :couchdb=>true, :elasticsearch=>true, +:elasticsearch_secure=>true, :export_cypher=>true, :integration=>true, :windows=>true} + +LogStash::Outputs::ZeroMQ + when in server mode + a ‘bound’ info line is logged (FAILED - 1) + +Failures: + + 1) LogStash::Outputs::ZeroMQ when in server mode a ‘bound’ info line is logged + Failure/Error: output.register + Double "logger" received :info with unexpected arguments + expected: ("0mq: bound", {:address=>"tcp://127.0.0.1:2120"}) + got: ("0mq: connected", {:address=>"tcp://127.0.0.1:2120"}) + # ./lib/logstash/util/zeromq.rb:21:in `setup' + # ./lib/logstash/outputs/zeromq.rb:92:in `register' + # ./lib/logstash/outputs/zeromq.rb:91:in `register' + # ./spec/outputs/zeromq_spec.rb:13:in `(root)' + # /Users/guy/.gem/jruby/1.9.3/gems/rspec-wait-0.0.7/lib/rspec/wait.rb:46:in `(root)' + +Finished in 0.133 seconds (files took 1.28 seconds to load) +1 example, 1 failure + +Failed examples: + +rspec ./spec/outputs/zeromq_spec.rb:10 # LogStash::Outputs::ZeroMQ when in server mode a ‘bound’ info line is logged + +Randomized with seed 2568 +``` + +To correct the error, open the `util/zeromq.rb` file in your text editor and swap the positions of the words `connected` and `bound` on line 21. Line 21 now reads: + +```ruby +@logger.info("0mq: #{server? ? 'bound' : 'connected'}", :address => address) +``` + +Run the test again with the `bundle exec rspec` command. + +The test passes with output similar to: + +```shell +Using Accessor#strict_set for specs +Run options: exclude {:redis=>true, :socket=>true, :performance=>true, :couchdb=>true, :elasticsearch=>true, :elasticsearch_secure=>true, :export_cypher=>true, :integration=>true, :windows=>true} + +LogStash::Outputs::ZeroMQ + when in server mode + a ‘bound’ info line is logged + +Finished in 0.114 seconds (files took 1.22 seconds to load) +1 example, 0 failures + +Randomized with seed 45887 +``` + +[Commit](https://help.github.com/articles/fork-a-repo/#next-steps) the changes to git and Github. + +Your pull request is visible from the [Pull Requests](https://github.com/logstash-plugins/logstash-output-zeromq/pulls) section of the original Github repository. The plugin maintainers review your work, suggest changes if necessary, and merge and publish a new version of the plugin. + + diff --git a/docs/extend/create-logstash-plugins.md b/docs/extend/create-logstash-plugins.md new file mode 100644 index 000000000..7dc5d5ba5 --- /dev/null +++ b/docs/extend/create-logstash-plugins.md @@ -0,0 +1,47 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/contributing-java-plugin.html +--- + +# Create Logstash plugins [contributing-java-plugin] + +Now you can write your own Java plugin for use with {{ls}}. We have provided instructions and GitHub examples to give you a head start. + +Native support for Java plugins in {{ls}} consists of several components: + +* Extensions to the Java execution engine to support running Java plugins in Logstash pipelines +* APIs for developing Java plugins. The APIs are in the `co.elastic.logstash.api` package. A Java plugin might break if it references classes or specific concrete implementations of API interfaces outside that package. The implementation of classes outside of the API package may change at any time. +* Tooling to automate the packaging and deployment of Java plugins in Logstash. + + +## Process overview [_process_overview] + +Here are the steps: + +1. Choose the type of plugin you want to create: input, codec, filter, or output. +2. Set up your environment. +3. Code the plugin. +4. Package and deploy the plugin. +5. Run Logstash with your new plugin. + + +### Let’s get started [_lets_get_started] + +Here are the example repos: + +* [Input plugin example](https://github.com/logstash-plugins/logstash-input-java_input_example) +* [Codec plugin example](https://github.com/logstash-plugins/logstash-codec-java_codec_example) +* [Filter plugin example](https://github.com/logstash-plugins/logstash-filter-java_filter_example) +* [Output plugin example](https://github.com/logstash-plugins/logstash-output-java_output_example) + +Here are the instructions: + +* [How to write a Java input plugin](/extend/java-input-plugin.md) +* [How to write a Java codec plugin](/extend/java-codec-plugin.md) +* [How to write a Java filter plugin](/extend/java-filter-plugin.md) +* [How to write a Java output plugin](/extend/java-output-plugin.md) + + + + + diff --git a/docs/extend/filter-new-plugin.md b/docs/extend/filter-new-plugin.md new file mode 100644 index 000000000..333b7137e --- /dev/null +++ b/docs/extend/filter-new-plugin.md @@ -0,0 +1,637 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/filter-new-plugin.html +--- + +# How to write a Logstash filter plugin [filter-new-plugin] + +To develop a new filter for Logstash, build a self-contained Ruby gem whose source code lives in its own GitHub repository. The Ruby gem can then be hosted and shared on RubyGems.org. You can use the example filter implementation as a starting point. (If you’re unfamiliar with Ruby, you can find an excellent quickstart guide at [https://www.ruby-lang.org/en/documentation/quickstart/](https://www.ruby-lang.org/en/documentation/quickstart/).) + +## Get started [_get_started_3] + +Let’s step through creating a filter plugin using the [example filter plugin](https://github.com/logstash-plugins/logstash-filter-example/). + +### Create a GitHub repo for your new plugin [_create_a_github_repo_for_your_new_plugin_3] + +Each Logstash plugin lives in its own GitHub repository. To create a new repository for your plugin: + +1. Log in to GitHub. +2. Click the **Repositories** tab. You’ll see a list of other repositories you’ve forked or contributed to. +3. Click the green **New** button in the upper right. +4. Specify the following settings for your new repo: + + * **Repository name** — a unique name of the form `logstash-filter-pluginname`. + * **Public or Private** — your choice, but the repository must be Public if you want to submit it as an official plugin. + * **Initialize this repository with a README** — enables you to immediately clone the repository to your computer. + +5. Click **Create Repository**. + + +### Use the plugin generator tool [_use_the_plugin_generator_tool_3] + +You can create your own Logstash plugin in seconds! The `generate` subcommand of `bin/logstash-plugin` creates the foundation for a new Logstash plugin with templatized files. It creates the correct directory structure, gemspec files, and dependencies so you can start adding custom code to process data with Logstash. + +For more information, see [Generating plugins](/reference/plugin-generator.md) + + +### Copy the filter code [_copy_the_filter_code] + +Alternatively, you can use the examples repo we host on github.com + +1. **Clone your plugin.** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``filter-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash``-filter-MYPLUGINNAME.git` + + * `cd logstash-filter-MYPLUGINNAME` + +2. **Clone the filter plugin example and copy it to your plugin branch.** + + You don’t want to include the example .git directory or its contents, so delete it before you copy the example. + + * `cd /tmp` + * `git clone https://github.com/logstash-plugins/logstash``-filter-example.git` + * `cd logstash-filter-example` + * `rm -rf .git` + * `cp -R * /path/to/logstash-filter-mypluginname/` + +3. **Rename the following files to match the name of your plugin.** + + * `logstash-filter-example.gemspec` + * `example.rb` + * `example_spec.rb` + + ```txt + cd /path/to/logstash-filter-mypluginname + mv logstash-filter-example.gemspec logstash-filter-mypluginname.gemspec + mv lib/logstash/filters/example.rb lib/logstash/filters/mypluginname.rb + mv spec/filters/example_spec.rb spec/filters/mypluginname_spec.rb + ``` + + +Your file structure should look like this: + +```txt +$ tree logstash-filter-mypluginname +├── Gemfile +├── LICENSE +├── README.md +├── Rakefile +├── lib +│   └── logstash +│   └── filters +│   └── mypluginname.rb +├── logstash-filter-mypluginname.gemspec +└── spec + └── filters + └── mypluginname_spec.rb +``` + +For more information about the Ruby gem file structure and an excellent walkthrough of the Ruby gem creation process, see [http://timelessrepo.com/making-ruby-gems](http://timelessrepo.com/making-ruby-gems) + + +### See what your plugin looks like [_see_what_your_plugin_looks_like_3] + +Before we dive into the details, open up the plugin file in your favorite text editor and take a look. + +```ruby +require "logstash/filters/base" +require "logstash/namespace" + +# Add any asciidoc formatted documentation here +# This example filter will replace the contents of the default +# message field with whatever you specify in the configuration. +# +# It is only intended to be used as an example. +class LogStash::Filters::Example < LogStash::Filters::Base + + # Setting the config_name here is required. This is how you + # configure this filter from your Logstash config. + # + # filter { + # example { message => "My message..." } + # } + config_name "example" + + # Replace the message with this value. + config :message, :validate => :string, :default => "Hello World!" + + + public + def register + # Add instance variables + end # def register + + public + def filter(event) + + if @message + # Replace the event message with our message as configured in the + # config file. + event.set("message", @message) + end + + # filter_matched should go in the last line of our successful code + filter_matched(event) + end # def filter + +end # class LogStash::Filters::Example +``` + + + +## Coding filter plugins [_coding_filter_plugins] + +Now let’s take a line-by-line look at the example plugin. + +### `require` Statements [_require_statements_3] + +Logstash filter plugins require parent classes defined in `logstash/filters/base` and logstash/namespace: + +```ruby +require "logstash/filters/base" +require "logstash/namespace" +``` + +Of course, the plugin you build may depend on other code, or even gems. Just put them here along with these Logstash dependencies. + + + +## Plugin Body [_plugin_body_3] + +Let’s go through the various elements of the plugin itself. + +### `class` Declaration [_class_declaration_3] + +The filter plugin class should be a subclass of `LogStash::Filters::Base`: + +```ruby +class LogStash::Filters::Example < LogStash::Filters::Base +``` + +The class name should closely mirror the plugin name, for example: + +```ruby +LogStash::Filters::Example +``` + + +### `config_name` [_config_name_3] + +```ruby + config_name "example" +``` + +This is the name your plugin will call inside the filter configuration block. + +If you set `config_name "example"` in your plugin code, the corresponding Logstash configuration block would need to look like this: + + + +## Configuration Parameters [_configuration_parameters_3] + +```ruby + config :variable_name, :validate => :variable_type, :default => "Default value", :required => boolean, :deprecated => boolean, :obsolete => string +``` + +The configuration, or `config` section allows you to define as many (or as few) parameters as are needed to enable Logstash to process events. + +There are several configuration attributes: + +* `:validate` - allows you to enforce passing a particular data type to Logstash for this configuration option, such as `:string`, `:password`, `:boolean`, `:number`, `:array`, `:hash`, `:path` (a file-system path), `uri`, `:codec` (since 1.2.0), `:bytes`. Note that this also works as a coercion in that if I specify "true" for boolean (even though technically a string), it will become a valid boolean in the config. This coercion works for the `:number` type as well where "1.2" becomes a float and "22" is an integer. +* `:default` - lets you specify a default value for a parameter +* `:required` - whether or not this parameter is mandatory (a Boolean `true` or +* `:list` - whether or not this value should be a list of values. Will typecheck the list members, and convert scalars to one element lists. Note that this mostly obviates the array type, though if you need lists of complex objects that will be more suitable. `false`) +* `:deprecated` - informational (also a Boolean `true` or `false`) +* `:obsolete` - used to declare that a given setting has been removed and is no longer functioning. The idea is to provide an informed upgrade path to users who are still using a now-removed setting. + + +## Plugin Methods [_plugin_methods_3] + +Logstash filters must implement the `register` and `filter` methods. + +### `register` Method [_register_method_3] + +```ruby + public + def register + end # def register +``` + +The Logstash `register` method is like an `initialize` method. It was originally created to enforce having `super` called, preventing headaches for newbies. (Note: It may go away in favor of `initialize`, in conjunction with some enforced testing to ensure `super` is called.) + +`public` means the method can be called anywhere, not just within the class. This is the default behavior for methods in Ruby, but it is specified explicitly here anyway. + +You can also assign instance variables here (variables prepended by `@`). Configuration variables are now in scope as instance variables, like `@message` + + +### `filter` Method [_filter_method] + +```ruby + public + def filter(event) + + if @message + # Replace the event message with our message as configured in the + # config file. + event.set("message", @message) + end + + # filter_matched should go in the last line of our successful code + filter_matched(event) +end # def filter +``` + +The plugin’s `filter` method is where the actual filtering work takes place! Inside the `filter` method you can refer to the event data using the `Event` object. Event is the main object that encapsulates data flow internally in Logstash and provides an [API](/reference/event-api.md) for the plugin developers to interact with the event’s content. + +The `filter` method should also handle any [event dependent configuration](/reference/event-dependent-configuration.md) by explicitly calling the `sprintf` method available in Event class. For example: + +```ruby +field_foo = event.sprintf(field) +``` + +Note that configuration variables are now in scope as instance variables, like `@message` + +```ruby + filter_matched(event) +``` + +Calling the `filter_matched` method upon successful execution of the plugin will ensure that any fields or tags added through the Logstash configuration for this filter will be handled correctly. For example, any `add_field`, `remove_field`, `add_tag` and/or `remove_tag` actions will be performed at this time. + +Event methods such as `event.cancel` are now available to control the workflow of the event being processed. + + + +## Building the Plugin [_building_the_plugin_3] + +At this point in the process you have coded your plugin and are ready to build a Ruby Gem from it. The following information will help you complete the process. + +### External dependencies [_external_dependencies_3] + +A `require` statement in Ruby is used to include necessary code. In some cases your plugin may require additional files. For example, the collectd plugin [uses](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/lib/logstash/codecs/collectd.rb#L148) the `types.db` file provided by collectd. In the main directory of your plugin, a file called `vendor.json` is where these files are described. + +The `vendor.json` file contains an array of JSON objects, each describing a file dependency. This example comes from the [collectd](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/vendor.json) codec plugin: + +```txt +[{ + "sha1": "a90fe6cc53b76b7bdd56dc57950d90787cb9c96e", + "url": "http://collectd.org/files/collectd-5.4.0.tar.gz", + "files": [ "/src/types.db" ] +}] +``` + +* `sha1` is the sha1 signature used to verify the integrity of the file referenced by `url`. +* `url` is the address from where Logstash will download the file. +* `files` is an optional array of files to extract from the downloaded file. Note that while tar archives can use absolute or relative paths, treat them as absolute in this array. If `files` is not present, all files will be uncompressed and extracted into the vendor directory. + +Another example of the `vendor.json` file is the [`geoip` filter](https://github.com/logstash-plugins/logstash-filter-geoip/blob/main/vendor.json) + +The process used to download these dependencies is to call `rake vendor`. This will be discussed further in the testing section of this document. + +Another kind of external dependency is on jar files. This will be described in the "Add a `gemspec` file" section. + + +### Deprecated features [_deprecated_features_3] + +As a plugin evolves, an option or feature may no longer serve the intended purpose, and the developer may want to *deprecate* its usage. Deprecation warns users about the option’s status, so they aren’t caught by surprise when it is removed in a later release. + +{{ls}} 7.6 introduced a *deprecation logger* to make handling those situations easier. You can use the [adapter](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support) to ensure that your plugin can use the deprecation logger while still supporting older versions of {{ls}}. See the [readme](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support/blob/main/README.md) for more information and for instructions on using the adapter. + +Deprecations are noted in the `logstash-deprecation.log` file in the `log` directory. + + +### Add a Gemfile [_add_a_gemfile_3] + +Gemfiles allow Ruby’s Bundler to maintain the dependencies for your plugin. Currently, all we’ll need is the Logstash gem, for testing, but if you require other gems, you should add them in here. + +::::{tip} +See [Bundler’s Gemfile page](http://bundler.io/gemfile.html) for more details. +:::: + + +```ruby +source 'https://rubygems.org' +gemspec +gem "logstash", :github => "elastic/logstash", :branch => "master" +``` + + + +## Add a `gemspec` file [_add_a_gemspec_file_3] + +Gemspecs define the Ruby gem which will be built and contain your plugin. + +::::{tip} +More information can be found on the [Rubygems Specification page](http://guides.rubygems.org/specification-reference/). +:::: + + +```ruby +Gem::Specification.new do |s| + s.name = 'logstash-filter-example' + s.version = '0.1.0' + s.licenses = ['Apache License (2.0)'] + s.summary = "This filter does x, y, z in Logstash" + s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" + s.authors = ["Elastic"] + s.email = 'info@elastic.co' + s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" + s.require_paths = ["lib"] + + # Files + s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT'] + # Tests + s.test_files = s.files.grep(%r{^(test|spec|features)/}) + + # Special flag to let us know this is actually a logstash plugin + s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" } + + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +end +``` + +It is appropriate to change these values to fit your plugin. In particular, `s.name` and `s.summary` should reflect your plugin’s name and behavior. + +`s.licenses` and `s.version` are also important and will come into play when you are ready to publish your plugin. + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elastic/logstash/blob/main/LICENSE.txt). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + +The gem version, designated by `s.version`, helps track changes to plugins over time. You should use [semver versioning](http://semver.org/) strategy for version numbers. + +### Runtime and Development Dependencies [_runtime_and_development_dependencies_3] + +At the bottom of the `gemspec` file is a section with a comment: `Gem dependencies`. This is where any other needed gems must be mentioned. If a gem is necessary for your plugin to function, it is a runtime dependency. If a gem are only used for testing, then it would be a development dependency. + +::::{note} +You can also have versioning requirements for your dependencies—​including other Logstash plugins: + +```ruby + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +``` + +This gemspec has a runtime dependency on the logstash-core-plugin-api and requires that it have a version number greater than or equal to version 1.60 and less than or equal to version 2.99. + +:::: + + +::::{important} +All plugins have a runtime dependency on the `logstash-core-plugin-api` gem, and a development dependency on `logstash-devutils`. +:::: + + + +### Jar dependencies [_jar_dependencies_3] + +In some cases, such as the [Elasticsearch output plugin](https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/main/logstash-output-elasticsearch.gemspec#L22-L23), your code may depend on a jar file. In cases such as this, the dependency is added in the gemspec file in this manner: + +```ruby + # Jar dependencies + s.requirements << "jar 'org.elasticsearch:elasticsearch', '5.0.0'" + s.add_runtime_dependency 'jar-dependencies' +``` + +With these both defined, the install process will search for the required jar file at [http://mvnrepository.com](http://mvnrepository.com) and download the specified version. + + + +## Document your plugin [_document_your_plugin_3] + +Documentation is an important part of your plugin. All plugin documentation is rendered and placed in the [Logstash Reference](/reference/index.md) and the [Versioned plugin docs](logstash-docs-md://vpr/integration-plugins.md). + +See [Document your plugin](/extend/plugin-doc.md) for tips and guidelines. + + +## Add Tests [_add_tests_3] + +Logstash loves tests. Lots of tests. If you’re using your new filter plugin in a production environment, you’ll want to have some tests to ensure you are not breaking any existing functionality. + +::::{note} +A full exposition on RSpec is outside the scope of this document. Learn more about RSpec at [http://rspec.info](http://rspec.info) +:::: + + +For help learning about tests and testing, look in the `spec/filters/` directory of several other similar plugins. + + +## Clone and test! [_clone_and_test_3] + +Now let’s start with a fresh clone of the plugin, build it and run the tests. + +* **Clone your plugin into a temporary location** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``filter-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash-``filter-MYPLUGINNAME.git` + + * `cd logstash-filter-MYPLUGINNAME` + + +Then, you’ll need to install your plugins dependencies with bundler: + +``` +bundle install +``` + +::::{important} +If your plugin has an external file dependency described in `vendor.json`, you must download that dependency before running or testing. You can do this by running: + +``` +rake vendor +``` + +:::: + + +And finally, run the tests: + +``` +bundle exec rspec +``` + +You should see a success message, which looks something like this: + +``` +Finished in 0.034 seconds +1 example, 0 failures +``` + +Hooray! You’re almost there! (Unless you saw failures…​ you should fix those first). + + +## Building and Testing [_building_and_testing_3] + +Now you’re ready to build your (well-tested) plugin into a Ruby gem. + +### Build [_build_3] + +You already have all the necessary ingredients, so let’s go ahead and run the build command: + +```sh +gem build logstash-filter-example.gemspec +``` + +That’s it! Your gem should be built and be in the same path with the name + +```sh +logstash-filter-mypluginname-0.1.0.gem +``` + +The `s.version` number from your gemspec file will provide the gem version, in this case, `0.1.0`. + + +### Test installation [_test_installation_3] + +You should test install your plugin into a clean installation of Logstash. Download the latest version from the [Logstash downloads page](https://www.elastic.co/downloads/logstash/). + +1. Untar and cd in to the directory: + + ```sh + curl -O https://download.elastic.co/logstash/logstash/logstash-9.0.0.tar.gz + tar xzvf logstash-9.0.0.tar.gz + cd logstash-9.0.0 + ``` + +2. Using the plugin tool, we can install the gem we just built. + + * Replace `/my/logstash/plugins` with the correct path to the gem for your environment, and `0.1.0` with the correct version number from the gemspec file. + + ```sh + bin/logstash-plugin install /my/logstash/plugins/logstash-filter-example/logstash-filter-example-0.1.0.gem + ``` + + * After running this, you should see feedback from Logstash that it was successfully installed: + + ```sh + validating /my/logstash/plugins/logstash-filter-example/logstash-filter-example-0.1.0.gem >= 0 + Valid logstash plugin. Continuing... + Successfully installed 'logstash-filter-example' with version '0.1.0' + ``` + + ::::{tip} + You can also use the Logstash plugin tool to determine which plugins are currently available: + + ```sh + bin/logstash-plugin list + ``` + + Depending on what you have installed, you might see a short or long list of plugins: inputs, codecs, filters and outputs. + + :::: + +3. Now try running Logstash with a simple configuration passed in via the command-line, using the `-e` flag. + + ::::{note} + Your results will depend on what your filter plugin is designed to do. + :::: + + +```sh +bin/logstash -e 'input { stdin{} } filter { example {} } output {stdout { codec => rubydebug }}' +``` + +Test your filter by sending input through `stdin` and output (after filtering) through `stdout` with the `rubydebug` codec, which enhances readability. + +In the case of the example filter plugin, any text you send will be replaced by the contents of the `message` configuration parameter, the default value being "Hello World!": + +```sh +Testing 1, 2, 3 +{ + "message" => "Hello World!", + "@version" => "1", + "@timestamp" => "2015-01-27T19:17:18.932Z", + "host" => "cadenza" +} +``` + +Feel free to experiment and test this by changing the `message` parameter: + +```sh +bin/logstash -e 'input { stdin{} } filter { example { message => "This is a new message!"} } output {stdout { codec => rubydebug }}' +``` + +Congratulations! You’ve built, deployed and successfully run a Logstash filter. + + + +## Submitting your plugin to [RubyGems.org](http://rubygems.org) and [logstash-plugins](https://github.com/logstash-plugins) [_submitting_your_plugin_to_rubygems_orghttprubygems_org_and_logstash_pluginshttpsgithub_comlogstash_plugins_3] + +Logstash uses [RubyGems.org](http://rubygems.org) as its repository for all plugin artifacts. Once you have developed your new plugin, you can make it available to Logstash users by simply publishing it to RubyGems.org. + +### Licensing [_licensing_3] + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elasticsearch/logstash/blob/main/LICENSE). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + + +### Publishing to [RubyGems.org](http://rubygems.org) [_publishing_to_rubygems_orghttprubygems_org_3] + +To begin, you’ll need an account on RubyGems.org + +* [Sign-up for a RubyGems account](https://rubygems.org/sign_up). + +After creating an account, [obtain](http://guides.rubygems.org/rubygems-org-api/#api-authorization) an API key from RubyGems.org. By default, RubyGems uses the file `~/.gem/credentials` to store your API key. These credentials will be used to publish the gem. Replace `username` and `password` with the credentials you created at RubyGems.org: + +```sh +curl -u username:password https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials +chmod 0600 ~/.gem/credentials +``` + +Before proceeding, make sure you have the right version in your gemspec file and commit your changes. + +* `s.version = '0.1.0'` + +To publish version 0.1.0 of your new logstash gem: + +```sh +bundle install +bundle exec rake vendor +bundle exec rspec +bundle exec rake publish_gem +``` + +::::{note} +Executing `rake publish_gem`: + +1. Reads the version from the gemspec file (`s.version = '0.1.0'`) +2. Checks in your local repository if a tag exists for that version. If the tag already exists, it aborts the process. Otherwise, it creates a new version tag in your local repository. +3. Builds the gem +4. Publishes the gem to RubyGems.org + +:::: + + +That’s it! Your plugin is published! Logstash users can now install your plugin by running: + +```sh +bin/logstash-plugin install logstash-filter-mypluginname +``` + + + +## Contributing your source code to [logstash-plugins](https://github.com/logstash-plugins) [_contributing_your_source_code_to_logstash_pluginshttpsgithub_comlogstash_plugins_3] + +It is not required to contribute your source code to [logstash-plugins](https://github.com/logstash-plugins) github organization, but we always welcome new plugins! + +### Benefits [_benefits_3] + +Some of the many benefits of having your plugin in the logstash-plugins repository are: + +* **Discovery.** Your plugin will appear in the [Logstash Reference](/reference/index.md), where Logstash users look first for plugins and documentation. +* **Documentation.** Your plugin documentation will automatically be added to the [Logstash Reference](/reference/index.md). +* **Testing.** With our testing infrastructure, your plugin will be continuously tested against current and future releases of Logstash. As a result, users will have the assurance that if incompatibilities arise, they will be quickly discovered and corrected. + + +### Acceptance Guidelines [_acceptance_guidelines_3] + +* **Code Review.** Your plugin must be reviewed by members of the community for coherence, quality, readability, stability and security. +* **Tests.** Your plugin must contain tests to be accepted. These tests are also subject to code review for scope and completeness. It’s ok if you don’t know how to write tests — we will guide you. We are working on publishing a guide to creating tests for Logstash which will make it easier. In the meantime, you can refer to [http://betterspecs.org/](http://betterspecs.org/) for examples. + +To begin migrating your plugin to logstash-plugins, simply create a new [issue](https://github.com/elasticsearch/logstash/issues) in the Logstash repository. When the acceptance guidelines are completed, we will facilitate the move to the logstash-plugins organization using the recommended [github process](https://help.github.com/articles/transferring-a-repository/#transferring-from-a-user-to-an-organization). diff --git a/docs/extend/index.md b/docs/extend/index.md new file mode 100644 index 000000000..9fd781332 --- /dev/null +++ b/docs/extend/index.md @@ -0,0 +1,58 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/contributing-to-logstash.html +--- + +# Contribute to Logstash [contributing-to-logstash] + +You can add your own input, codec, filter, or output plugins to Logstash. + + +### Acceptance guidelines [plugin-acceptance] + +Start with the end in mind. These guidelines and best practices can help you build a better plugin, even if you choose not to share it with the world. + +* **Consistency.** Your plugin must be consistent in quality and naming conventions used by other plugins. The plugin name must be unique and in this format: `logstash-plugintype-pluginname`. If the plugin name is more than one word, separate words after plugin type with underscores. Example: *logstash-output-elastic_app_search* +* **Documentation.** Documentation is a required component of your plugin. If we list your plugin in the Logstash Reference, we point to your documentation—​a readme.md, docs/index.asciidoc, or both—​in your plugin repo. +* **Code Review.** Your plugin must be reviewed by members of the community for coherence, quality, readability, stability and security. +* **Tests.** Your plugin must contain tests to be accepted. You can refer to [http://betterspecs.org/](http://betterspecs.org/) for examples. + + * Step 1. Enable travis on your account + * Step 2. Import our standard travis.yml [https://github.com/logstash-plugins/.ci/blob/1.x/travis/travis.yml](https://github.com/logstash-plugins/.ci/blob/1.x/travis/travis.yml), as shown in the [fingerprint filter example](https://github.com/logstash-plugins/logstash-filter-fingerprint/blob/main/.travis.yml). + * Step 3. Have specs in the spec folder. + + + +## Add a plugin [add-plugin] + +Plugins can be developed and deployed independently of the Logstash core. Here are some documents to guide you through the process of coding, deploying, and sharing your plugin: + +* Write a new plugin + + * [How to write a Logstash input plugin](/extend/input-new-plugin.md) + * [How to write a Logstash codec plugin](/extend/codec-new-plugin.md) + * [How to write a Logstash filter plugin](/extend/filter-new-plugin.md) + * [How to write a Logstash output plugin](/extend/output-new-plugin.md) + * [Community Maintainer’s Guide](/extend/community-maintainer.md) + +* [Document your plugin](/extend/plugin-doc.md) +* [Publish your plugin to RubyGems.org](/extend/publish-plugin.md) +* [List your plugin](/extend/plugin-listing.md) +* Contribute a patch + + * [Contributing a patch to a Logstash plugin](/extend/contributing-patch-plugin.md) + * [Extending Logstash core](/extend/contribute-to-core.md) + + + +#### Plugin Shutdown APIs [shutdown-apis] + +You have three options for shutting down a plugin: `stop`, `stop?`, and `close`. + +* Call the `stop` method from outside the plugin thread. This method signals the plugin to stop. +* The `stop?` method returns `true` when the `stop` method has already been called for that plugin. +* The `close` method performs final bookkeeping and cleanup after the plugin’s `run` method and the plugin’s thread both exit. The `close` method is a a new name for the method known as `teardown` in previous versions of Logstash. + +The `shutdown`, `finished`, `finished?`, `running?`, and `terminating?` methods are redundant and no longer present in the Plugin Base class. + +Sample code for the plugin shutdown APIs is [available](https://github.com/logstash-plugins/logstash-input-example/blob/main/lib/logstash/inputs/example.rb). diff --git a/docs/extend/input-new-plugin.md b/docs/extend/input-new-plugin.md new file mode 100644 index 000000000..35e4d057d --- /dev/null +++ b/docs/extend/input-new-plugin.md @@ -0,0 +1,674 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/input-new-plugin.html +--- + +# How to write a Logstash input plugin [input-new-plugin] + +To develop a new input for Logstash, build a self-contained Ruby gem whose source code lives in its own GitHub repository. The Ruby gem can then be hosted and shared on RubyGems.org. You can use the example input implementation as a starting point. (If you’re unfamiliar with Ruby, you can find an excellent quickstart guide at [https://www.ruby-lang.org/en/documentation/quickstart/](https://www.ruby-lang.org/en/documentation/quickstart/).) + +## Get started [_get_started] + +Let’s step through creating an input plugin using the [example input plugin](https://github.com/logstash-plugins/logstash-input-example/). + +### Create a GitHub repo for your new plugin [_create_a_github_repo_for_your_new_plugin] + +Each Logstash plugin lives in its own GitHub repository. To create a new repository for your plugin: + +1. Log in to GitHub. +2. Click the **Repositories** tab. You’ll see a list of other repositories you’ve forked or contributed to. +3. Click the green **New** button in the upper right. +4. Specify the following settings for your new repo: + + * **Repository name** — a unique name of the form `logstash-input-pluginname`. + * **Public or Private** — your choice, but the repository must be Public if you want to submit it as an official plugin. + * **Initialize this repository with a README** — enables you to immediately clone the repository to your computer. + +5. Click **Create Repository**. + + +### Use the plugin generator tool [_use_the_plugin_generator_tool] + +You can create your own Logstash plugin in seconds! The `generate` subcommand of `bin/logstash-plugin` creates the foundation for a new Logstash plugin with templatized files. It creates the correct directory structure, gemspec files, and dependencies so you can start adding custom code to process data with Logstash. + +For more information, see [Generating plugins](/reference/plugin-generator.md) + + +### Copy the input code [_copy_the_input_code] + +Alternatively, you can use the examples repo we host on github.com + +1. **Clone your plugin.** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``input-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash``-input-MYPLUGINNAME.git` + + * `cd logstash-input-MYPLUGINNAME` + +2. **Clone the input plugin example and copy it to your plugin branch.** + + You don’t want to include the example .git directory or its contents, so delete it before you copy the example. + + * `cd /tmp` + * `git clone https://github.com/logstash-plugins/logstash``-input-example.git` + * `cd logstash-input-example` + * `rm -rf .git` + * `cp -R * /path/to/logstash-input-mypluginname/` + +3. **Rename the following files to match the name of your plugin.** + + * `logstash-input-example.gemspec` + * `example.rb` + * `example_spec.rb` + + ```txt + cd /path/to/logstash-input-mypluginname + mv logstash-input-example.gemspec logstash-input-mypluginname.gemspec + mv lib/logstash/inputs/example.rb lib/logstash/inputs/mypluginname.rb + mv spec/inputs/example_spec.rb spec/inputs/mypluginname_spec.rb + ``` + + +Your file structure should look like this: + +```txt +$ tree logstash-input-mypluginname +├── Gemfile +├── LICENSE +├── README.md +├── Rakefile +├── lib +│   └── logstash +│   └── inputs +│   └── mypluginname.rb +├── logstash-input-mypluginname.gemspec +└── spec + └── inputs + └── mypluginname_spec.rb +``` + +For more information about the Ruby gem file structure and an excellent walkthrough of the Ruby gem creation process, see [http://timelessrepo.com/making-ruby-gems](http://timelessrepo.com/making-ruby-gems) + + +### See what your plugin looks like [_see_what_your_plugin_looks_like] + +Before we dive into the details, open up the plugin file in your favorite text editor and take a look. + +```ruby +require "logstash/inputs/base" +require "logstash/namespace" +require "stud/interval" +require "socket" # for Socket.gethostname + +# Add any asciidoc formatted documentation here +# Generate a repeating message. +# +# This plugin is intended only as an example. + +class LogStash::Inputs::Example < LogStash::Inputs::Base + config_name "example" + + # If undefined, Logstash will complain, even if codec is unused. + default :codec, "plain" + + # The message string to use in the event. + config :message, :validate => :string, :default => "Hello World!" + + # Set how frequently messages should be sent. + # + # The default, `1`, means send a message every second. + config :interval, :validate => :number, :default => 1 + + public + def register + @host = Socket.gethostname + end # def register + + def run(queue) + Stud.interval(@interval) do + event = LogStash::Event.new("message" => @message, "host" => @host) + decorate(event) + queue << event + end # loop + end # def run + +end # class LogStash::Inputs::Example +``` + + + +## Coding input plugins [_coding_input_plugins] + +Now let’s take a line-by-line look at the example plugin. + +### `require` Statements [_require_statements] + +Logstash input plugins require parent classes defined in `logstash/inputs/base` and logstash/namespace: + +```ruby +require "logstash/inputs/base" +require "logstash/namespace" +``` + +Of course, the plugin you build may depend on other code, or even gems. Just put them here along with these Logstash dependencies. + + + +## Plugin Body [_plugin_body] + +Let’s go through the various elements of the plugin itself. + +### `class` Declaration [_class_declaration] + +The input plugin class should be a subclass of `LogStash::Inputs::Base`: + +```ruby +class LogStash::Inputs::Example < LogStash::Inputs::Base +``` + +The class name should closely mirror the plugin name, for example: + +```ruby +LogStash::Inputs::Example +``` + + +### `config_name` [_config_name] + +```ruby + config_name "example" +``` + +This is the name your plugin will call inside the input configuration block. + +If you set `config_name "example"` in your plugin code, the corresponding Logstash configuration block would need to look like this: + +```js +input { + example {...} +} +``` + + + +## Configuration Parameters [_configuration_parameters] + +```ruby + config :variable_name, :validate => :variable_type, :default => "Default value", :required => boolean, :deprecated => boolean, :obsolete => string +``` + +The configuration, or `config` section allows you to define as many (or as few) parameters as are needed to enable Logstash to process events. + +There are several configuration attributes: + +* `:validate` - allows you to enforce passing a particular data type to Logstash for this configuration option, such as `:string`, `:password`, `:boolean`, `:number`, `:array`, `:hash`, `:path` (a file-system path), `uri`, `:codec` (since 1.2.0), `:bytes`. Note that this also works as a coercion in that if I specify "true" for boolean (even though technically a string), it will become a valid boolean in the config. This coercion works for the `:number` type as well where "1.2" becomes a float and "22" is an integer. +* `:default` - lets you specify a default value for a parameter +* `:required` - whether or not this parameter is mandatory (a Boolean `true` or +* `:list` - whether or not this value should be a list of values. Will typecheck the list members, and convert scalars to one element lists. Note that this mostly obviates the array type, though if you need lists of complex objects that will be more suitable. `false`) +* `:deprecated` - informational (also a Boolean `true` or `false`) +* `:obsolete` - used to declare that a given setting has been removed and is no longer functioning. The idea is to provide an informed upgrade path to users who are still using a now-removed setting. + + +## Plugin Methods [_plugin_methods] + +Logstash inputs must implement two main methods: `register` and `run`. + +### `register` Method [_register_method] + +```ruby + public + def register + end # def register +``` + +The Logstash `register` method is like an `initialize` method. It was originally created to enforce having `super` called, preventing headaches for newbies. (Note: It may go away in favor of `initialize`, in conjunction with some enforced testing to ensure `super` is called.) + +`public` means the method can be called anywhere, not just within the class. This is the default behavior for methods in Ruby, but it is specified explicitly here anyway. + +You can also assign instance variables here (variables prepended by `@`). Configuration variables are now in scope as instance variables, like `@message` + + +### `run` Method [_run_method] + +The example input plugin has the following `run` Method: + +```ruby + def run(queue) + Stud.interval(@interval) do + event = LogStash::Event.new("message" => @message, "host" => @host) + decorate(event) + queue << event + end # loop + end # def run +``` + +The `run` method is where a stream of data from an input becomes an event. + +The stream can be plain or generated as with the [heartbeat](https://github.com/logstash-plugins/logstash-input-heartbeat/blob/main/lib/logstash/inputs/heartbeat.rb#L43-L61) input plugin. In these cases, though no codec is used, [a default codec](https://github.com/logstash-plugins/logstash-input-heartbeat/blob/main/lib/logstash/inputs/heartbeat.rb#L17) must be set in the code to avoid errors. + +Here’s another example `run` method: + +```ruby + def run(queue) + while true + begin + # Based on some testing, there is no way to interrupt an IO.sysread nor + # IO.select call in JRuby. + data = $stdin.sysread(16384) + @codec.decode(data) do |event| + decorate(event) + event.set("host", @host) if !event.include?("host") + queue << event + end + rescue IOError, EOFError, LogStash::ShutdownSignal + # stdin closed or a requested shutdown + break + end + end # while true + finished + end # def run +``` + +In this example, the `data` is being sent to the codec defined in the configuration block to `decode` the data stream and return an event. + +In both examples, the resulting `event` is passed to the `decorate` method: + +```ruby + decorate(event) +``` + +This applies any tags you might have set in the input configuration block. For example, `tags => ["tag1", "tag2"]`. + +Also in both examples, the `event`, after being "decorated," is appended to the queue: + +```ruby + queue << event +``` + +This inserts the event into the pipeline. + +::::{tip} +Because input plugins can range from simple to complex, it is helpful to see more examples of how they have been created: + +* [syslog](https://github.com/logstash-plugins/logstash-input-syslog/blob/main/lib/logstash/inputs/syslog.rb) +* [zeromq](https://github.com/logstash-plugins/logstash-input-zeromq/blob/main/lib/logstash/inputs/zeromq.rb) +* [stdin](https://github.com/logstash-plugins/logstash-input-stdin/blob/main/lib/logstash/inputs/stdin.rb) +* [tcp](https://github.com/logstash-plugins/logstash-input-tcp/blob/main/lib/logstash/inputs/tcp.rb) + +There are many more more examples in the [logstash-plugin github repository](https://github.com/logstash-plugins?query=logstash-input). + +:::: + + + + +## Building the Plugin [_building_the_plugin] + +At this point in the process you have coded your plugin and are ready to build a Ruby Gem from it. The following information will help you complete the process. + +### External dependencies [_external_dependencies] + +A `require` statement in Ruby is used to include necessary code. In some cases your plugin may require additional files. For example, the collectd plugin [uses](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/lib/logstash/codecs/collectd.rb#L148) the `types.db` file provided by collectd. In the main directory of your plugin, a file called `vendor.json` is where these files are described. + +The `vendor.json` file contains an array of JSON objects, each describing a file dependency. This example comes from the [collectd](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/vendor.json) codec plugin: + +```txt +[{ + "sha1": "a90fe6cc53b76b7bdd56dc57950d90787cb9c96e", + "url": "http://collectd.org/files/collectd-5.4.0.tar.gz", + "files": [ "/src/types.db" ] +}] +``` + +* `sha1` is the sha1 signature used to verify the integrity of the file referenced by `url`. +* `url` is the address from where Logstash will download the file. +* `files` is an optional array of files to extract from the downloaded file. Note that while tar archives can use absolute or relative paths, treat them as absolute in this array. If `files` is not present, all files will be uncompressed and extracted into the vendor directory. + +Another example of the `vendor.json` file is the [`geoip` filter](https://github.com/logstash-plugins/logstash-filter-geoip/blob/main/vendor.json) + +The process used to download these dependencies is to call `rake vendor`. This will be discussed further in the testing section of this document. + +Another kind of external dependency is on jar files. This will be described in the "Add a `gemspec` file" section. + + +### Deprecated features [_deprecated_features] + +As a plugin evolves, an option or feature may no longer serve the intended purpose, and the developer may want to *deprecate* its usage. Deprecation warns users about the option’s status, so they aren’t caught by surprise when it is removed in a later release. + +{{ls}} 7.6 introduced a *deprecation logger* to make handling those situations easier. You can use the [adapter](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support) to ensure that your plugin can use the deprecation logger while still supporting older versions of {{ls}}. See the [readme](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support/blob/main/README.md) for more information and for instructions on using the adapter. + +Deprecations are noted in the `logstash-deprecation.log` file in the `log` directory. + + +### Add a Gemfile [_add_a_gemfile] + +Gemfiles allow Ruby’s Bundler to maintain the dependencies for your plugin. Currently, all we’ll need is the Logstash gem, for testing, but if you require other gems, you should add them in here. + +::::{tip} +See [Bundler’s Gemfile page](http://bundler.io/gemfile.html) for more details. +:::: + + +```ruby +source 'https://rubygems.org' +gemspec +gem "logstash", :github => "elastic/logstash", :branch => "master" +``` + + + +## Add a `gemspec` file [_add_a_gemspec_file] + +Gemspecs define the Ruby gem which will be built and contain your plugin. + +::::{tip} +More information can be found on the [Rubygems Specification page](http://guides.rubygems.org/specification-reference/). +:::: + + +```ruby +Gem::Specification.new do |s| + s.name = 'logstash-input-example' + s.version = '0.1.0' + s.licenses = ['Apache License (2.0)'] + s.summary = "This input does x, y, z in Logstash" + s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" + s.authors = ["Elastic"] + s.email = 'info@elastic.co' + s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" + s.require_paths = ["lib"] + + # Files + s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT'] + # Tests + s.test_files = s.files.grep(%r{^(test|spec|features)/}) + + # Special flag to let us know this is actually a logstash plugin + s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" } + + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +end +``` + +It is appropriate to change these values to fit your plugin. In particular, `s.name` and `s.summary` should reflect your plugin’s name and behavior. + +`s.licenses` and `s.version` are also important and will come into play when you are ready to publish your plugin. + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elastic/logstash/blob/main/LICENSE.txt). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + +The gem version, designated by `s.version`, helps track changes to plugins over time. You should use [semver versioning](http://semver.org/) strategy for version numbers. + +### Runtime and Development Dependencies [_runtime_and_development_dependencies] + +At the bottom of the `gemspec` file is a section with a comment: `Gem dependencies`. This is where any other needed gems must be mentioned. If a gem is necessary for your plugin to function, it is a runtime dependency. If a gem are only used for testing, then it would be a development dependency. + +::::{note} +You can also have versioning requirements for your dependencies—​including other Logstash plugins: + +```ruby + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +``` + +This gemspec has a runtime dependency on the logstash-core-plugin-api and requires that it have a version number greater than or equal to version 1.60 and less than or equal to version 2.99. + +:::: + + +::::{important} +All plugins have a runtime dependency on the `logstash-core-plugin-api` gem, and a development dependency on `logstash-devutils`. +:::: + + + +### Jar dependencies [_jar_dependencies] + +In some cases, such as the [Elasticsearch output plugin](https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/main/logstash-output-elasticsearch.gemspec#L22-L23), your code may depend on a jar file. In cases such as this, the dependency is added in the gemspec file in this manner: + +```ruby + # Jar dependencies + s.requirements << "jar 'org.elasticsearch:elasticsearch', '5.0.0'" + s.add_runtime_dependency 'jar-dependencies' +``` + +With these both defined, the install process will search for the required jar file at [http://mvnrepository.com](http://mvnrepository.com) and download the specified version. + + + +## Document your plugin [_document_your_plugin] + +Documentation is an important part of your plugin. All plugin documentation is rendered and placed in the [Logstash Reference](/reference/index.md) and the [Versioned plugin docs](logstash-docs-md://vpr/integration-plugins.md). + +See [Document your plugin](/extend/plugin-doc.md) for tips and guidelines. + + +## Add Tests [_add_tests] + +Logstash loves tests. Lots of tests. If you’re using your new input plugin in a production environment, you’ll want to have some tests to ensure you are not breaking any existing functionality. + +::::{note} +A full exposition on RSpec is outside the scope of this document. Learn more about RSpec at [http://rspec.info](http://rspec.info) +:::: + + +For help learning about tests and testing, look in the `spec/inputs/` directory of several other similar plugins. + + +## Clone and test! [_clone_and_test] + +Now let’s start with a fresh clone of the plugin, build it and run the tests. + +* **Clone your plugin into a temporary location** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``input-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash-``input-MYPLUGINNAME.git` + + * `cd logstash-input-MYPLUGINNAME` + + +Then, you’ll need to install your plugins dependencies with bundler: + +``` +bundle install +``` + +::::{important} +If your plugin has an external file dependency described in `vendor.json`, you must download that dependency before running or testing. You can do this by running: + +``` +rake vendor +``` + +:::: + + +And finally, run the tests: + +``` +bundle exec rspec +``` + +You should see a success message, which looks something like this: + +``` +Finished in 0.034 seconds +1 example, 0 failures +``` + +Hooray! You’re almost there! (Unless you saw failures…​ you should fix those first). + + +## Building and Testing [_building_and_testing] + +Now you’re ready to build your (well-tested) plugin into a Ruby gem. + +### Build [_build] + +You already have all the necessary ingredients, so let’s go ahead and run the build command: + +```sh +gem build logstash-input-example.gemspec +``` + +That’s it! Your gem should be built and be in the same path with the name + +```sh +logstash-input-mypluginname-0.1.0.gem +``` + +The `s.version` number from your gemspec file will provide the gem version, in this case, `0.1.0`. + + +### Test installation [_test_installation] + +You should test install your plugin into a clean installation of Logstash. Download the latest version from the [Logstash downloads page](https://www.elastic.co/downloads/logstash/). + +1. Untar and cd in to the directory: + + ```sh + curl -O https://download.elastic.co/logstash/logstash/logstash-9.0.0.tar.gz + tar xzvf logstash-9.0.0.tar.gz + cd logstash-9.0.0 + ``` + +2. Using the plugin tool, we can install the gem we just built. + + * Replace `/my/logstash/plugins` with the correct path to the gem for your environment, and `0.1.0` with the correct version number from the gemspec file. + + ```sh + bin/logstash-plugin install /my/logstash/plugins/logstash-input-example/logstash-input-example-0.1.0.gem + ``` + + * After running this, you should see feedback from Logstash that it was successfully installed: + + ```sh + validating /my/logstash/plugins/logstash-input-example/logstash-input-example-0.1.0.gem >= 0 + Valid logstash plugin. Continuing... + Successfully installed 'logstash-input-example' with version '0.1.0' + ``` + + ::::{tip} + You can also use the Logstash plugin tool to determine which plugins are currently available: + + ```sh + bin/logstash-plugin list + ``` + + Depending on what you have installed, you might see a short or long list of plugins: inputs, codecs, filters and outputs. + + :::: + +3. Now try running Logstash with a simple configuration passed in via the command-line, using the `-e` flag. + + ::::{note} + Your results will depend on what your input plugin is designed to do. + :::: + + +```sh +bin/logstash -e 'input { example{} } output {stdout { codec => rubydebug }}' +``` + +The example input plugin will send the contents of `message` (with a default message of "Hello World!") every second. + +```sh +{ + "message" => "Hello World!", + "@version" => "1", + "@timestamp" => "2015-01-27T19:17:18.932Z", + "host" => "cadenza" +} +``` + +Feel free to experiment and test this by changing the `message` and `interval` parameters: + +```sh +bin/logstash -e 'input { example{ message => "A different message" interval => 5 } } output {stdout { codec => rubydebug }}' +``` + +Congratulations! You’ve built, deployed and successfully run a Logstash input. + + + +## Submitting your plugin to [RubyGems.org](http://rubygems.org) and [logstash-plugins](https://github.com/logstash-plugins) [_submitting_your_plugin_to_rubygems_orghttprubygems_org_and_logstash_pluginshttpsgithub_comlogstash_plugins] + +Logstash uses [RubyGems.org](http://rubygems.org) as its repository for all plugin artifacts. Once you have developed your new plugin, you can make it available to Logstash users by simply publishing it to RubyGems.org. + +### Licensing [_licensing] + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elasticsearch/logstash/blob/main/LICENSE). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + + +### Publishing to [RubyGems.org](http://rubygems.org) [_publishing_to_rubygems_orghttprubygems_org] + +To begin, you’ll need an account on RubyGems.org + +* [Sign-up for a RubyGems account](https://rubygems.org/sign_up). + +After creating an account, [obtain](http://guides.rubygems.org/rubygems-org-api/#api-authorization) an API key from RubyGems.org. By default, RubyGems uses the file `~/.gem/credentials` to store your API key. These credentials will be used to publish the gem. Replace `username` and `password` with the credentials you created at RubyGems.org: + +```sh +curl -u username:password https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials +chmod 0600 ~/.gem/credentials +``` + +Before proceeding, make sure you have the right version in your gemspec file and commit your changes. + +* `s.version = '0.1.0'` + +To publish version 0.1.0 of your new logstash gem: + +```sh +bundle install +bundle exec rake vendor +bundle exec rspec +bundle exec rake publish_gem +``` + +::::{note} +Executing `rake publish_gem`: + +1. Reads the version from the gemspec file (`s.version = '0.1.0'`) +2. Checks in your local repository if a tag exists for that version. If the tag already exists, it aborts the process. Otherwise, it creates a new version tag in your local repository. +3. Builds the gem +4. Publishes the gem to RubyGems.org + +:::: + + +That’s it! Your plugin is published! Logstash users can now install your plugin by running: + +```sh +bin/logstash-plugin install logstash-input-mypluginname +``` + + + +## Contributing your source code to [logstash-plugins](https://github.com/logstash-plugins) [_contributing_your_source_code_to_logstash_pluginshttpsgithub_comlogstash_plugins] + +It is not required to contribute your source code to [logstash-plugins](https://github.com/logstash-plugins) github organization, but we always welcome new plugins! + +### Benefits [_benefits] + +Some of the many benefits of having your plugin in the logstash-plugins repository are: + +* **Discovery.** Your plugin will appear in the [Logstash Reference](/reference/index.md), where Logstash users look first for plugins and documentation. +* **Documentation.** Your plugin documentation will automatically be added to the [Logstash Reference](/reference/index.md). +* **Testing.** With our testing infrastructure, your plugin will be continuously tested against current and future releases of Logstash. As a result, users will have the assurance that if incompatibilities arise, they will be quickly discovered and corrected. + + +### Acceptance Guidelines [_acceptance_guidelines] + +* **Code Review.** Your plugin must be reviewed by members of the community for coherence, quality, readability, stability and security. +* **Tests.** Your plugin must contain tests to be accepted. These tests are also subject to code review for scope and completeness. It’s ok if you don’t know how to write tests — we will guide you. We are working on publishing a guide to creating tests for Logstash which will make it easier. In the meantime, you can refer to [http://betterspecs.org/](http://betterspecs.org/) for examples. + +To begin migrating your plugin to logstash-plugins, simply create a new [issue](https://github.com/elasticsearch/logstash/issues) in the Logstash repository. When the acceptance guidelines are completed, we will facilitate the move to the logstash-plugins organization using the recommended [github process](https://help.github.com/articles/transferring-a-repository/#transferring-from-a-user-to-an-organization). diff --git a/docs/extend/java-codec-plugin.md b/docs/extend/java-codec-plugin.md new file mode 100644 index 000000000..75c0562ed --- /dev/null +++ b/docs/extend/java-codec-plugin.md @@ -0,0 +1,348 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/java-codec-plugin.html +--- + +# How to write a Java codec plugin [java-codec-plugin] + +::::{note} +Java codecs are currently supported only for Java input and output plugins. They will not work with Ruby input or output plugins. +:::: + + +To develop a new Java codec for Logstash, you write a new Java class that conforms to the Logstash Java Codecs API, package it, and install it with the logstash-plugin utility. We’ll go through each of those steps. + + +## Set up your environment [_set_up_your_environment_2] + + +### Copy the example repo [_copy_the_example_repo_2] + +Start by copying the [example codec plugin](https://github.com/logstash-plugins/logstash-codec-java_codec_example). The plugin API is currently part of the Logstash codebase so you must have a local copy of that available. You can obtain a copy of the Logstash codebase with the following `git` command: + +```shell +git clone --branch --single-branch https://github.com/elastic/logstash.git +``` + +The `branch_name` should correspond to the version of Logstash containing the preferred revision of the Java plugin API. + +::::{note} +The GA version of the Java plugin API is available in the `7.2` and later branches of the Logstash codebase. +:::: + + +Specify the `target_folder` for your local copy of the Logstash codebase. If you do not specify `target_folder`, it defaults to a new folder called `logstash` under your current folder. + + +### Generate the .jar file [_generate_the_jar_file_2] + +After you have obtained a copy of the appropriate revision of the Logstash codebase, you need to compile it to generate the .jar file containing the Java plugin API. From the root directory of your Logstash codebase ($LS_HOME), you can compile it with `./gradlew assemble` (or `gradlew.bat assemble` if you’re running on Windows). This should produce the `$LS_HOME/logstash-core/build/libs/logstash-core-x.y.z.jar` where `x`, `y`, and `z` refer to the version of Logstash. + +After you have successfully compiled Logstash, you need to tell your Java plugin where to find the `logstash-core-x.y.z.jar` file. Create a new file named `gradle.properties` in the root folder of your plugin project. That file should have a single line: + +```txt +LOGSTASH_CORE_PATH=/logstash-core +``` + +where `target_folder` is the root folder of your local copy of the Logstash codebase. + + +## Code the plugin [_code_the_plugin_2] + +The example codec plugin decodes messages separated by a configurable delimiter and encodes messages by writing their string representation separated by a delimiter. For example, if the codec were configured with `/` as the delimiter, the input text `event1/event2/` would be decoded into two separate events with `message` fields of `event1` and `event2`, respectively. Note that this is only an example codec and does not cover all the edge cases that a production-grade codec should cover. + +Let’s look at the main class in that codec filter: + +```java +@LogstashPlugin(name="java_codec_example") +public class JavaCodecExample implements Codec { + + public static final PluginConfigSpec DELIMITER_CONFIG = + PluginConfigSpec.stringSetting("delimiter", ","); + + private final String id; + private final String delimiter; + + public JavaCodecExample(final Configuration config, final Context context) { + this(config.get(DELIMITER_CONFIG)); + } + + private JavaCodecExample(String delimiter) { + this.id = UUID.randomUUID().toString(); + this.delimiter = delimiter; + } + + @Override + public void decode(ByteBuffer byteBuffer, Consumer> consumer) { + // a not-production-grade delimiter decoder + byte[] byteInput = new byte[byteBuffer.remaining()]; + byteBuffer.get(byteInput); + if (byteInput.length > 0) { + String input = new String(byteInput); + String[] split = input.split(delimiter); + for (String s : split) { + Map map = new HashMap<>(); + map.put("message", s); + consumer.accept(map); + } + } + } + + @Override + public void flush(ByteBuffer byteBuffer, Consumer> consumer) { + // if the codec maintains any internal state such as partially-decoded input, this + // method should flush that state along with any additional input supplied in + // the ByteBuffer + + decode(byteBuffer, consumer); // this is a simplistic implementation + } + + @Override + public void encode(Event event, OutputStream outputStream) throws IOException { + outputStream.write((event.toString() + delimiter).getBytes(Charset.defaultCharset())); + } + + @Override + public Collection> configSchema() { + // should return a list of all configuration options for this plugin + return Collections.singletonList(DELIMITER_CONFIG); + } + + @Override + public Codec cloneCodec() { + return new JavaCodecExample(this.delimiter); + } + + @Override + public String getId() { + return this.id; + } + +} +``` + +Let’s step through and examine each part of that class. + + +### Class declaration [_class_declaration_6] + +```java +@LogstashPlugin(name="java_codec_example") +public class JavaCodecExample implements Codec { +``` + +Notes about the class declaration: + +* All Java plugins must be annotated with the `@LogstashPlugin` annotation. Additionally: + + * The `name` property of the annotation must be supplied and defines the name of the plugin as it will be used in the Logstash pipeline definition. For example, this codec would be referenced in the codec section of the an appropriate input or output in the Logstash pipeline defintion as `codec => java_codec_example { }` + * The value of the `name` property must match the name of the class excluding casing and underscores. + +* The class must implement the `co.elastic.logstash.api.Codec` interface. +* Java plugins may not be created in the `org.logstash` or `co.elastic.logstash` packages to prevent potential clashes with classes in Logstash itself. + + +#### Plugin settings [_plugin_settings_2] + +The snippet below contains both the setting definition and the method referencing it: + +```java +public static final PluginConfigSpec DELIMITER_CONFIG = + PluginConfigSpec.stringSetting("delimiter", ","); + +@Override +public Collection> configSchema() { + return Collections.singletonList(DELIMITER_CONFIG); +} +``` + +The `PluginConfigSpec` class allows developers to specify the settings that a plugin supports complete with setting name, data type, deprecation status, required status, and default value. In this example, the `delimiter` setting defines the delimiter on which the codec will split events. It is not a required setting and if it is not explicitly set, its default value will be `,`. + +The `configSchema` method must return a list of all settings that the plugin supports. The Logstash execution engine will validate that all required settings are present and that no unsupported settings are present. + + +#### Constructor and initialization [_constructor_and_initialization_2] + +```java +private final String id; +private final String delimiter; + +public JavaCodecExample(final Configuration config, final Context context) { + this(config.get(DELIMITER_CONFIG)); +} + +private JavaCodecExample(String delimiter) { + this.id = UUID.randomUUID().toString(); + this.delimiter = delimiter; +} +``` + +All Java codec plugins must have a constructor taking a `Configuration` and `Context` argument. This is the constructor that will be used to instantiate them at runtime. The retrieval and validation of all plugin settings should occur in this constructor. In this example, the delimiter to be used for delimiting events is retrieved from its setting and stored in a local variable so that it can be used later in the `decode` and `encode` methods. The codec’s ID is initialized to a random UUID (as should be done for most codecs), and a local `encoder` variable is initialized to encode and decode with a specified character set. + +Any additional initialization may occur in the constructor as well. If there are any unrecoverable errors encountered in the configuration or initialization of the codec plugin, a descriptive exception should be thrown. The exception will be logged and will prevent Logstash from starting. + + +### Codec methods [_codec_methods] + +```java +@Override +public void decode(ByteBuffer byteBuffer, Consumer> consumer) { + // a not-production-grade delimiter decoder + byte[] byteInput = new byte[byteBuffer.remaining()]; + byteBuffer.get(byteInput); + if (byteInput.length > 0) { + String input = new String(byteInput); + String[] split = input.split(delimiter); + for (String s : split) { + Map map = new HashMap<>(); + map.put("message", s); + consumer.accept(map); + } + } +} + +@Override +public void flush(ByteBuffer byteBuffer, Consumer> consumer) { + // if the codec maintains any internal state such as partially-decoded input, this + // method should flush that state along with any additional input supplied in + // the ByteBuffer + + decode(byteBuffer, consumer); // this is a simplistic implementation +} + +@Override +public void encode(Event event, OutputStream outputStream) throws IOException { + outputStream.write((event.toString() + delimiter).getBytes(Charset.defaultCharset())); +} +``` + +The `decode`, `flush`, and `encode` methods provide the core functionality of the codec. Codecs may be used by inputs to decode a sequence or stream of bytes into events or by outputs to encode events into a sequence of bytes. + +The `decode` method decodes events from the specified `ByteBuffer` and passes them to the provided `Consumer`. The input must provide a `ByteBuffer` that is ready for reading with `byteBuffer.position()` indicating the next position to read and `byteBuffer.limit()` indicating the first byte in the buffer that is not safe to read. Codecs must ensure that `byteBuffer.position()` reflects the last-read position before returning control to the input. The input is then responsible for returning the buffer to write mode via either `byteBuffer.clear()` or `byteBuffer.compact()` before resuming writes. In the example above, the `decode` method simply splits the incoming byte stream on the specified delimiter. A production-grade codec such as [`java-line`](https://github.com/elastic/logstash/blob/main/logstash-core/src/main/java/org/logstash/plugins/codecs/Line.java) would not make the simplifying assumption that the end of the supplied byte stream corresponded with the end of an event. + +Events should be constructed as instances of `Map` and pushed into the event pipeline via the `Consumer>.accept()` method. To reduce allocations and GC pressure, codecs may reuse the same map instance by modifying its fields between calls to `Consumer>.accept()` because the event pipeline will create events based on a copy of the map’s data. + +The `flush` method works in coordination with the `decode` method to decode all remaining events from the specified `ByteBuffer` along with any internal state that may remain after previous calls to the `decode` method. As an example of internal state that a codec might maintain, consider an input stream of bytes `event1/event2/event3` with a delimiter of `/`. Due to buffering or other reasons, the input might supply a partial stream of bytes such as `event1/eve` to the codec’s `decode` method. In this case, the codec could save the beginning three characters `eve` of the second event rather than assuming that the supplied byte stream ends on an event boundary. If the next call to `decode` supplied the `nt2/ev` bytes, the codec would prepend the saved `eve` bytes to produce the full `event2` event and then save the remaining `ev` bytes for decoding when the remainder of the bytes for that event were supplied. A call to `flush` signals the codec that the supplied bytes represent the end of an event stream and all remaining bytes should be decoded to events. The `flush` example above is a simplistic implementation that does not maintain any state about partially-supplied byte streams across calls to `decode`. + +The `encode` method encodes an event into a sequence of bytes and writes it into the specified `OutputStream`. Because a single codec instance is shared across all pipeline workers in the output stage of the Logstash pipeline, codecs should *not* retain state across calls to their `encode` methods. + + +### cloneCodec method [_clonecodec_method] + +```java +@Override +public Codec cloneCodec() { + return new JavaCodecExample(this.delimiter); +} +``` + +The `cloneCodec` method should return an identical instance of the codec with the exception of its ID. Because codecs may be stateful across calls to their `decode` methods, input plugins that are multi-threaded should use a separate instance of each codec via the `cloneCodec` method for each of their threads. Because a single codec instance is shared across all pipeline workers in the output stage of the Logstash pipeline, codecs should *not* retain state across calls to their `encode` methods. In the example above, the codec is cloned with the same delimiter but a different ID. + + +### getId method [_getid_method_2] + +```java +@Override +public String getId() { + return id; +} +``` + +For codec plugins, the `getId` method should always return the id that was set at instantiation time. This is typically an UUID. + + +### Unit tests [_unit_tests_2] + +Lastly, but certainly not least importantly, unit tests are strongly encouraged. The example codec plugin includes an [example unit test](https://github.com/logstash-plugins/logstash-codec-java_codec_example/blob/main/src/test/java/org/logstashplugins/JavaCodecExampleTest.java) that you can use as a template for your own. + + +## Package and deploy [_package_and_deploy_2] + +Java plugins are packaged as Ruby gems for dependency management and interoperability with Ruby plugins. Once they are packaged as gems, they may be installed with the `logstash-plugin` utility just as Ruby plugins are. Because no knowledge of Ruby or its toolchain should be required for Java plugin development, the procedure for packaging Java plugins as Ruby gems has been automated through a custom task in the Gradle build file provided with the example Java plugins. The following sections describe how to configure and execute that packaging task as well as how to install the packaged Java plugin in Logstash. + + +### Configuring the Gradle packaging task [_configuring_the_gradle_packaging_task_2] + +The following section appears near the top of the `build.gradle` file supplied with the example Java plugins: + +```java +// =========================================================================== +// plugin info +// =========================================================================== +group 'org.logstashplugins' // must match the package of the main plugin class +version "${file("VERSION").text.trim()}" // read from required VERSION file +description = "Example Java filter implementation" +pluginInfo.licenses = ['Apache-2.0'] // list of SPDX license IDs +pluginInfo.longDescription = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using \$LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" +pluginInfo.authors = ['Elasticsearch'] +pluginInfo.email = ['info@elastic.co'] +pluginInfo.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" +pluginInfo.pluginType = "filter" +pluginInfo.pluginClass = "JavaFilterExample" +pluginInfo.pluginName = "java_filter_example" +// =========================================================================== +``` + +You should configure the values above for your plugin. + +* The `version` value will be automatically read from the `VERSION` file in the root of your plugin’s codebase. +* `pluginInfo.pluginType` should be set to one of `input`, `filter`, `codec`, or `output`. +* `pluginInfo.pluginName` must match the name specified on the `@LogstashPlugin` annotation on the main plugin class. The Gradle packaging task will validate that and return an error if they do not match. + + +### Running the Gradle packaging task [_running_the_gradle_packaging_task_2] + +Several Ruby source files along with a `gemspec` file and a `Gemfile` are required to package the plugin as a Ruby gem. These Ruby files are used only for defining the Ruby gem structure or at Logstash startup time to register the Java plugin. They are not used during runtime event processing. The Gradle packaging task automatically generates all of these files based on the values configured in the section above. + +You run the Gradle packaging task with the following command: + +```shell +./gradlew gem +``` + +For Windows platforms: Substitute `gradlew.bat` for `./gradlew` as appropriate in the command. + +That task will produce a gem file in the root directory of your plugin’s codebase with the name `logstash-{{plugintype}}--.gem` + + +### Installing the Java plugin in Logstash [_installing_the_java_plugin_in_logstash_2] + +After you have packaged your Java plugin as a Ruby gem, you can install it in Logstash with this command: + +```shell +bin/logstash-plugin install --no-verify --local /path/to/javaPlugin.gem +``` + +For Windows platforms: Substitute backslashes for forward slashes as appropriate in the command. + + +## Run Logstash with the Java codec plugin [_run_logstash_with_the_java_codec_plugin] + +To test the plugin, start Logstash with: + +```java +echo "foo,bar" | bin/logstash -e 'input { java_stdin { codec => java_codec_example } }' +``` + +The expected Logstash output (excluding initialization) with the configuration above is: + +```txt +{ + "@version" => "1", + "message" => "foo", + "@timestamp" => yyyy-MM-ddThh:mm:ss.SSSZ, + "host" => "" +} +{ + "@version" => "1", + "message" => "bar\n", + "@timestamp" => yyyy-MM-ddThh:mm:ss.SSSZ, + "host" => "" +} +``` + + +## Feedback [_feedback_2] + +If you have any feedback on Java plugin support in Logstash, please comment on our [main Github issue](https://github.com/elastic/logstash/issues/9215) or post in the [Logstash forum](https://discuss.elastic.co/c/logstash). + diff --git a/docs/extend/java-filter-plugin.md b/docs/extend/java-filter-plugin.md new file mode 100644 index 000000000..69c68204b --- /dev/null +++ b/docs/extend/java-filter-plugin.md @@ -0,0 +1,307 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/java-filter-plugin.html +--- + +# How to write a Java filter plugin [java-filter-plugin] + +To develop a new Java filter for Logstash, you write a new Java class that conforms to the Logstash Java Filters API, package it, and install it with the logstash-plugin utility. We’ll go through each of those steps. + + +## Set up your environment [_set_up_your_environment_3] + + +### Copy the example repo [_copy_the_example_repo_3] + +Start by copying the [example filter plugin](https://github.com/logstash-plugins/logstash-filter-java_filter_example). The plugin API is currently part of the Logstash codebase so you must have a local copy of that available. You can obtain a copy of the Logstash codebase with the following `git` command: + +```shell +git clone --branch --single-branch https://github.com/elastic/logstash.git +``` + +The `branch_name` should correspond to the version of Logstash containing the preferred revision of the Java plugin API. + +::::{note} +The GA version of the Java plugin API is available in the `7.2` and later branches of the Logstash codebase. +:::: + + +Specify the `target_folder` for your local copy of the Logstash codebase. If you do not specify `target_folder`, it defaults to a new folder called `logstash` under your current folder. + + +### Generate the .jar file [_generate_the_jar_file_3] + +After you have obtained a copy of the appropriate revision of the Logstash codebase, you need to compile it to generate the .jar file containing the Java plugin API. From the root directory of your Logstash codebase ($LS_HOME), you can compile it with `./gradlew assemble` (or `gradlew.bat assemble` if you’re running on Windows). This should produce the `$LS_HOME/logstash-core/build/libs/logstash-core-x.y.z.jar` where `x`, `y`, and `z` refer to the version of Logstash. + +After you have successfully compiled Logstash, you need to tell your Java plugin where to find the `logstash-core-x.y.z.jar` file. Create a new file named `gradle.properties` in the root folder of your plugin project. That file should have a single line: + +```txt +LOGSTASH_CORE_PATH=/logstash-core +``` + +where `target_folder` is the root folder of your local copy of the Logstash codebase. + + +## Code the plugin [_code_the_plugin_3] + +The example filter plugin allows one to configure a field in each event that will be reversed. For example, if the filter were configured to reverse the `day_of_week` field, an event with `day_of_week: "Monday"` would be transformed to `day_of_week: "yadnoM"`. Let’s look at the main class in that example filter: + +```java +@LogstashPlugin(name = "java_filter_example") +public class JavaFilterExample implements Filter { + + public static final PluginConfigSpec SOURCE_CONFIG = + PluginConfigSpec.stringSetting("source", "message"); + + private String id; + private String sourceField; + + public JavaFilterExample(String id, Configuration config, Context context) { + this.id = id; + this.sourceField = config.get(SOURCE_CONFIG); + } + + @Override + public Collection filter(Collection events, FilterMatchListener matchListener) { + for (Event e : events) { + Object f = e.getField(sourceField); + if (f instanceof String) { + e.setField(sourceField, StringUtils.reverse((String)f)); + matchListener.filterMatched(e); + } + } + return events; + } + + @Override + public Collection> configSchema() { + return Collections.singletonList(SOURCE_CONFIG); + } + + @Override + public String getId() { + return this.id; + } + + @Override + public void close() { + this.sourceField = null; + return; + } +} +``` + +Let’s step through and examine each part of that class. + + +### Class declaration [_class_declaration_7] + +```java +@LogstashPlugin(name = "java_filter_example") +public class JavaFilterExample implements Filter { +``` + +Notes about the class declaration: + +* All Java plugins must be annotated with the `@LogstashPlugin` annotation. Additionally: + + * The `name` property of the annotation must be supplied and defines the name of the plugin as it will be used in the Logstash pipeline definition. For example, this filter would be referenced in the filter section of the Logstash pipeline defintion as `filter { java_filter_example => { .... } }` + * The value of the `name` property must match the name of the class excluding casing and underscores. + +* The class must implement the `co.elastic.logstash.api.Filter` interface. +* Java plugins may not be created in the `org.logstash` or `co.elastic.logstash` packages to prevent potential clashes with classes in Logstash itself. + + +### Plugin settings [_plugin_settings_3] + +The snippet below contains both the setting definition and the method referencing it: + +```java +public static final PluginConfigSpec SOURCE_CONFIG = + PluginConfigSpec.stringSetting("source", "message"); + +@Override +public Collection> configSchema() { + return Collections.singletonList(SOURCE_CONFIG); +} +``` + +The `PluginConfigSpec` class allows developers to specify the settings that a plugin supports complete with setting name, data type, deprecation status, required status, and default value. In this example, the `source` setting defines the name of the field in each event that will be reversed. It is not a required setting and if it is not explicitly set, its default value will be `message`. + +The `configSchema` method must return a list of all settings that the plugin supports. In a future phase of the Java plugin project, the Logstash execution engine will validate that all required settings are present and that no unsupported settings are present. + + +### Constructor and initialization [_constructor_and_initialization_3] + +```java +private String id; +private String sourceField; + +public JavaFilterExample(String id, Configuration config, Context context) { + this.id = id; + this.sourceField = config.get(SOURCE_CONFIG); +} +``` + +All Java filter plugins must have a constructor taking a `String` id and a `Configuration` and `Context` argument. This is the constructor that will be used to instantiate them at runtime. The retrieval and validation of all plugin settings should occur in this constructor. In this example, the name of the field to be reversed in each event is retrieved from its setting and stored in a local variable so that it can be used later in the `filter` method. + +Any additional initialization may occur in the constructor as well. If there are any unrecoverable errors encountered in the configuration or initialization of the filter plugin, a descriptive exception should be thrown. The exception will be logged and will prevent Logstash from starting. + + +### Filter method [_filter_method_2] + +```java +@Override +public Collection filter(Collection events, FilterMatchListener matchListener) { + for (Event e : events) { + Object f = e.getField(sourceField); + if (f instanceof String) { + e.setField(sourceField, StringUtils.reverse((String)f)); + matchListener.filterMatched(e); + } + } + return events; +``` + +Finally, we come to the `filter` method that is invoked by the Logstash execution engine on batches of events as they flow through the event processing pipeline. The events to be filtered are supplied in the `events` argument and the method should return a collection of filtered events. Filters may perform a variety of actions on events as they flow through the pipeline including: + +* Mutation — Fields in events may be added, removed, or changed by a filter. This is the most common scenario for filters that perform various kinds of enrichment on events. In this scenario, the incoming `events` collection may be returned unmodified since the events in the collection are mutated in place. +* Deletion — Events may be removed from the event pipeline by a filter so that subsequent filters and outputs do not receive them. In this scenario, the events to be deleted must be removed from the collection of filtered events before it is returned. +* Creation — A filter may insert new events into the event pipeline that will be seen only by subsequent filters and outputs. In this scenario, the new events must be added to the collection of filtered events before it is returned. +* Observation — Events may pass unchanged by a filter through the event pipeline. This may be useful in scenarios where a filter performs external actions (e.g., updating an external cache) based on the events observed in the event pipeline. In this scenario, the incoming `events` collection may be returned unmodified since no changes were made. + +In the example above, the value of the `source` field is retrieved from each event and reversed if it is a string value. Because each event is mutated in place, the incoming `events` collection can be returned. + +The `matchListener` is the mechanism by which filters indicate which events "match". The common actions for filters such as `add_field` and `add_tag` are applied only to events that are designated as "matching". Some filters such as the [grok filter](logstash-docs-md://lsr/plugins-filters-grok.md) have a clear definition for what constitutes a matching event and will notify the listener only for matching events. Other filters such as the [UUID filter](logstash-docs-md://lsr/plugins-filters-uuid.md) have no specific match criteria and should notify the listener for every event filtered. In this example, the filter notifies the match listener for any event that had a `String` value in its `source` field and was therefore able to be reversed. + + +### getId method [_getid_method_3] + +```java +@Override +public String getId() { + return id; +} +``` + +For filter plugins, the `getId` method should always return the id that was provided to the plugin through its constructor at instantiation time. + + +### close method [_close_method] + +```java +@Override +public void close() { + // shutdown a resource that was instantiated during the filter initialization phase. + this.sourceField = null; + return; +} +``` + +Filter plugins can use additional resources to perform operations, such as creating new database connections. Implementing the `close` method will allow the plugins to free up those resources when shutting down the pipeline. + + +### Unit tests [_unit_tests_3] + +Lastly, but certainly not least importantly, unit tests are strongly encouraged. The example filter plugin includes an [example unit test](https://github.com/logstash-plugins/logstash-filter-java_filter_example/blob/main/src/test/java/org/logstashplugins/JavaFilterExampleTest.java) that you can use as a template for your own. + + +## Package and deploy [_package_and_deploy_3] + +Java plugins are packaged as Ruby gems for dependency management and interoperability with Ruby plugins. Once they are packaged as gems, they may be installed with the `logstash-plugin` utility just as Ruby plugins are. Because no knowledge of Ruby or its toolchain should be required for Java plugin development, the procedure for packaging Java plugins as Ruby gems has been automated through a custom task in the Gradle build file provided with the example Java plugins. The following sections describe how to configure and execute that packaging task as well as how to install the packaged Java plugin in Logstash. + + +### Configuring the Gradle packaging task [_configuring_the_gradle_packaging_task_3] + +The following section appears near the top of the `build.gradle` file supplied with the example Java plugins: + +```java +// =========================================================================== +// plugin info +// =========================================================================== +group 'org.logstashplugins' // must match the package of the main plugin class +version "${file("VERSION").text.trim()}" // read from required VERSION file +description = "Example Java filter implementation" +pluginInfo.licenses = ['Apache-2.0'] // list of SPDX license IDs +pluginInfo.longDescription = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using \$LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" +pluginInfo.authors = ['Elasticsearch'] +pluginInfo.email = ['info@elastic.co'] +pluginInfo.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" +pluginInfo.pluginType = "filter" +pluginInfo.pluginClass = "JavaFilterExample" +pluginInfo.pluginName = "java_filter_example" +// =========================================================================== +``` + +You should configure the values above for your plugin. + +* The `version` value will be automatically read from the `VERSION` file in the root of your plugin’s codebase. +* `pluginInfo.pluginType` should be set to one of `input`, `filter`, `codec`, or `output`. +* `pluginInfo.pluginName` must match the name specified on the `@LogstashPlugin` annotation on the main plugin class. The Gradle packaging task will validate that and return an error if they do not match. + + +### Running the Gradle packaging task [_running_the_gradle_packaging_task_3] + +Several Ruby source files along with a `gemspec` file and a `Gemfile` are required to package the plugin as a Ruby gem. These Ruby files are used only for defining the Ruby gem structure or at Logstash startup time to register the Java plugin. They are not used during runtime event processing. The Gradle packaging task automatically generates all of these files based on the values configured in the section above. + +You run the Gradle packaging task with the following command: + +```shell +./gradlew gem +``` + +For Windows platforms: Substitute `gradlew.bat` for `./gradlew` as appropriate in the command. + +That task will produce a gem file in the root directory of your plugin’s codebase with the name `logstash-{{plugintype}}--.gem` + + +### Installing the Java plugin in Logstash [_installing_the_java_plugin_in_logstash_3] + +After you have packaged your Java plugin as a Ruby gem, you can install it in Logstash with this command: + +```shell +bin/logstash-plugin install --no-verify --local /path/to/javaPlugin.gem +``` + +For Windows platforms: Substitute backslashes for forward slashes as appropriate in the command. + + +## Run Logstash with the Java filter plugin [_run_logstash_with_the_java_filter_plugin] + +The following is a minimal Logstash configuration that can be used to test that the Java filter plugin is correctly installed and functioning. + +```java +input { + generator { message => "Hello world!" count => 1 } +} +filter { + java_filter_example {} +} +output { + stdout { codec => rubydebug } +} +``` + +Copy the above Logstash configuration to a file such as `java_filter.conf`. Start Logstash with: + +```shell +bin/logstash -f /path/to/java_filter.conf +``` + +The expected Logstash output (excluding initialization) with the configuration above is: + +```txt +{ + "sequence" => 0, + "@version" => "1", + "message" => "!dlrow olleH", + "@timestamp" => yyyy-MM-ddThh:mm:ss.SSSZ, + "host" => "" +} +``` + + +## Feedback [_feedback_3] + +If you have any feedback on Java plugin support in Logstash, please comment on our [main Github issue](https://github.com/elastic/logstash/issues/9215) or post in the [Logstash forum](https://discuss.elastic.co/c/logstash). + diff --git a/docs/extend/java-input-plugin.md b/docs/extend/java-input-plugin.md new file mode 100644 index 000000000..240a1be9e --- /dev/null +++ b/docs/extend/java-input-plugin.md @@ -0,0 +1,341 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/java-input-plugin.html +--- + +# How to write a Java input plugin [java-input-plugin] + +To develop a new Java input for Logstash, you write a new Java class that conforms to the Logstash Java Inputs API, package it, and install it with the logstash-plugin utility. We’ll go through each of those steps. + + +## Set up your environment [_set_up_your_environment] + + +### Copy the example repo [_copy_the_example_repo] + +Start by copying the [example input plugin](https://github.com/logstash-plugins/logstash-input-java_input_example). The plugin API is currently part of the Logstash codebase so you must have a local copy of that available. You can obtain a copy of the Logstash codebase with the following `git` command: + +```shell +git clone --branch --single-branch https://github.com/elastic/logstash.git +``` + +The `branch_name` should correspond to the version of Logstash containing the preferred revision of the Java plugin API. + +::::{note} +The GA version of the Java plugin API is available in the `7.2` and later branches of the Logstash codebase. +:::: + + +Specify the `target_folder` for your local copy of the Logstash codebase. If you do not specify `target_folder`, it defaults to a new folder called `logstash` under your current folder. + + +### Generate the .jar file [_generate_the_jar_file] + +After you have obtained a copy of the appropriate revision of the Logstash codebase, you need to compile it to generate the .jar file containing the Java plugin API. From the root directory of your Logstash codebase ($LS_HOME), you can compile it with `./gradlew assemble` (or `gradlew.bat assemble` if you’re running on Windows). This should produce the `$LS_HOME/logstash-core/build/libs/logstash-core-x.y.z.jar` where `x`, `y`, and `z` refer to the version of Logstash. + +After you have successfully compiled Logstash, you need to tell your Java plugin where to find the `logstash-core-x.y.z.jar` file. Create a new file named `gradle.properties` in the root folder of your plugin project. That file should have a single line: + +```txt +LOGSTASH_CORE_PATH=/logstash-core +``` + +where `target_folder` is the root folder of your local copy of the Logstash codebase. + + +## Code the plugin [_code_the_plugin] + +The example input plugin generates a configurable number of simple events before terminating. Let’s look at the main class in the example input. + +```java +@LogstashPlugin(name="java_input_example") +public class JavaInputExample implements Input { + + public static final PluginConfigSpec EVENT_COUNT_CONFIG = + PluginConfigSpec.numSetting("count", 3); + + public static final PluginConfigSpec PREFIX_CONFIG = + PluginConfigSpec.stringSetting("prefix", "message"); + + private String id; + private long count; + private String prefix; + private final CountDownLatch done = new CountDownLatch(1); + private volatile boolean stopped; + + + public JavaInputExample(String id, Configuration config, Context context) { + this.id = id; + count = config.get(EVENT_COUNT_CONFIG); + prefix = config.get(PREFIX_CONFIG); + } + + @Override + public void start(Consumer> consumer) { + int eventCount = 0; + try { + while (!stopped && eventCount < count) { + eventCount++; + consumer.accept.push(Collections.singletonMap("message", + prefix + " " + StringUtils.center(eventCount + " of " + count, 20))); + } + } finally { + stopped = true; + done.countDown(); + } + } + + @Override + public void stop() { + stopped = true; // set flag to request cooperative stop of input + } + + @Override + public void awaitStop() throws InterruptedException { + done.await(); // blocks until input has stopped + } + + @Override + public Collection> configSchema() { + return Arrays.asList(EVENT_COUNT_CONFIG, PREFIX_CONFIG); + } + + @Override + public String getId() { + return this.id; + } +} +``` + +Let’s step through and examine each part of that class. + + +### Class declaration [_class_declaration_5] + +```java +@LogstashPlugin(name="java_input_example") +public class JavaInputExample implements Input { +``` + +Notes about the class declaration: + +* All Java plugins must be annotated with the `@LogstashPlugin` annotation. Additionally: + + * The `name` property of the annotation must be supplied and defines the name of the plugin as it will be used in the Logstash pipeline definition. For example, this input would be referenced in the input section of the Logstash pipeline defintion as `input { java_input_example => { .... } }` + * The value of the `name` property must match the name of the class excluding casing and underscores. + +* The class must implement the `co.elastic.logstash.api.Input` interface. +* Java plugins may not be created in the `org.logstash` or `co.elastic.logstash` packages to prevent potential clashes with classes in Logstash itself. + + +### Plugin settings [_plugin_settings] + +The snippet below contains both the setting definition and the method referencing it. + +```java +public static final PluginConfigSpec EVENT_COUNT_CONFIG = + PluginConfigSpec.numSetting("count", 3); + +public static final PluginConfigSpec PREFIX_CONFIG = + PluginConfigSpec.stringSetting("prefix", "message"); + +@Override +public Collection> configSchema() { + return Arrays.asList(EVENT_COUNT_CONFIG, PREFIX_CONFIG); +} +``` + +The `PluginConfigSpec` class allows developers to specify the settings that a plugin supports complete with setting name, data type, deprecation status, required status, and default value. In this example, the `count` setting defines the number of events that will be generated and the `prefix` setting defines an optional prefix to include in the event field. Neither setting is required and if it is not explicitly set, the settings default to `3` and `message`, respectively. + +The `configSchema` method must return a list of all settings that the plugin supports. In a future phase of the Java plugin project, the Logstash execution engine will validate that all required settings are present and that no unsupported settings are present. + + +### Constructor and initialization [_constructor_and_initialization] + +```java +private String id; +private long count; +private String prefix; + +public JavaInputExample(String id, Configuration config, Context context) { + this.id = id; + count = config.get(EVENT_COUNT_CONFIG); + prefix = config.get(PREFIX_CONFIG); +} +``` + +All Java input plugins must have a constructor taking a `String` id and `Configuration` and `Context` argument. This is the constructor that will be used to instantiate them at runtime. The retrieval and validation of all plugin settings should occur in this constructor. In this example, the values of the two plugin settings are retrieved and stored in local variables for later use in the `start` method. + +Any additional initialization may occur in the constructor as well. If there are any unrecoverable errors encountered in the configuration or initialization of the input plugin, a descriptive exception should be thrown. The exception will be logged and will prevent Logstash from starting. + + +### Start method [_start_method] + +```java +@Override +public void start(Consumer> consumer) { + int eventCount = 0; + try { + while (!stopped && eventCount < count) { + eventCount++; + consumer.accept.push(Collections.singletonMap("message", + prefix + " " + StringUtils.center(eventCount + " of " + count, 20))); + } + } finally { + stopped = true; + done.countDown(); + } +} +``` + +The `start` method begins the event-producing loop in an input. Inputs are flexible and may produce events through many different mechanisms including: + +* a pull mechanism such as periodic queries of external database +* a push mechanism such as events sent from clients to a local network port +* a timed computation such as a heartbeat +* any other mechanism that produces a useful stream of events. Event streams may be either finite or infinite. If the input produces an infinite stream of events, this method should loop until a stop request is made through the `stop` method. If the input produces a finite stream of events, this method should terminate when the last event in the stream is produced or a stop request is made, whichever comes first. + +Events should be constructed as instances of `Map` and pushed into the event pipeline via the `Consumer>.accept()` method. To reduce allocations and GC pressure, inputs may reuse the same map instance by modifying its fields between calls to `Consumer>.accept()` because the event pipeline will create events based on a copy of the map’s data. + + +### Stop and awaitStop methods [_stop_and_awaitstop_methods] + +```java +private final CountDownLatch done = new CountDownLatch(1); +private volatile boolean stopped; + +@Override +public void stop() { + stopped = true; // set flag to request cooperative stop of input +} + +@Override +public void awaitStop() throws InterruptedException { + done.await(); // blocks until input has stopped +} +``` + +The `stop` method notifies the input to stop producing events. The stop mechanism may be implemented in any way that honors the API contract though a `volatile boolean` flag works well for many use cases. + +Inputs stop both asynchronously and cooperatively. Use the `awaitStop` method to block until the input has completed the stop process. Note that this method should **not** signal the input to stop as the `stop` method does. The awaitStop mechanism may be implemented in any way that honors the API contract though a `CountDownLatch` works well for many use cases. + + +### getId method [_getid_method] + +```java +@Override +public String getId() { + return id; +} +``` + +For input plugins, the `getId` method should always return the id that was provided to the plugin through its constructor at instantiation time. + + +### Unit tests [_unit_tests] + +Lastly, but certainly not least importantly, unit tests are strongly encouraged. The example input plugin includes an [example unit test](https://github.com/logstash-plugins/logstash-input-java_input_example/blob/main/src/test/java/org/logstashplugins/JavaInputExampleTest.java) that you can use as a template for your own. + + +## Package and deploy [_package_and_deploy] + +Java plugins are packaged as Ruby gems for dependency management and interoperability with Ruby plugins. Once they are packaged as gems, they may be installed with the `logstash-plugin` utility just as Ruby plugins are. Because no knowledge of Ruby or its toolchain should be required for Java plugin development, the procedure for packaging Java plugins as Ruby gems has been automated through a custom task in the Gradle build file provided with the example Java plugins. The following sections describe how to configure and execute that packaging task as well as how to install the packaged Java plugin in Logstash. + + +### Configuring the Gradle packaging task [_configuring_the_gradle_packaging_task] + +The following section appears near the top of the `build.gradle` file supplied with the example Java plugins: + +```java +// =========================================================================== +// plugin info +// =========================================================================== +group 'org.logstashplugins' // must match the package of the main plugin class +version "${file("VERSION").text.trim()}" // read from required VERSION file +description = "Example Java filter implementation" +pluginInfo.licenses = ['Apache-2.0'] // list of SPDX license IDs +pluginInfo.longDescription = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using \$LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" +pluginInfo.authors = ['Elasticsearch'] +pluginInfo.email = ['info@elastic.co'] +pluginInfo.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" +pluginInfo.pluginType = "filter" +pluginInfo.pluginClass = "JavaFilterExample" +pluginInfo.pluginName = "java_filter_example" +// =========================================================================== +``` + +You should configure the values above for your plugin. + +* The `version` value will be automatically read from the `VERSION` file in the root of your plugin’s codebase. +* `pluginInfo.pluginType` should be set to one of `input`, `filter`, `codec`, or `output`. +* `pluginInfo.pluginName` must match the name specified on the `@LogstashPlugin` annotation on the main plugin class. The Gradle packaging task will validate that and return an error if they do not match. + + +### Running the Gradle packaging task [_running_the_gradle_packaging_task] + +Several Ruby source files along with a `gemspec` file and a `Gemfile` are required to package the plugin as a Ruby gem. These Ruby files are used only for defining the Ruby gem structure or at Logstash startup time to register the Java plugin. They are not used during runtime event processing. The Gradle packaging task automatically generates all of these files based on the values configured in the section above. + +You run the Gradle packaging task with the following command: + +```shell +./gradlew gem +``` + +For Windows platforms: Substitute `gradlew.bat` for `./gradlew` as appropriate in the command. + +That task will produce a gem file in the root directory of your plugin’s codebase with the name `logstash-{{plugintype}}--.gem` + + +### Installing the Java plugin in Logstash [_installing_the_java_plugin_in_logstash] + +After you have packaged your Java plugin as a Ruby gem, you can install it in Logstash with this command: + +```shell +bin/logstash-plugin install --no-verify --local /path/to/javaPlugin.gem +``` + +For Windows platforms: Substitute backslashes for forward slashes as appropriate in the command. + + +## Running Logstash with the Java input plugin [_running_logstash_with_the_java_input_plugin] + +The following is a minimal Logstash configuration that can be used to test that the Java input plugin is correctly installed and functioning. + +```java +input { + java_input_example {} +} +output { + stdout { codec => rubydebug } +} +``` + +Copy the above Logstash configuration to a file such as `java_input.conf`. Start {{ls}} with: + +```shell +bin/logstash -f /path/to/java_input.conf +``` + +The expected Logstash output (excluding initialization) with the configuration above is: + +```txt +{ + "@version" => "1", + "message" => "message 1 of 3 ", + "@timestamp" => yyyy-MM-ddThh:mm:ss.SSSZ +} +{ + "@version" => "1", + "message" => "message 2 of 3 ", + "@timestamp" => yyyy-MM-ddThh:mm:ss.SSSZ +} +{ + "@version" => "1", + "message" => "message 3 of 3 ", + "@timestamp" => yyyy-MM-ddThh:mm:ss.SSSZ +} +``` + + +## Feedback [_feedback] + +If you have any feedback on Java plugin support in Logstash, please comment on our [main Github issue](https://github.com/elastic/logstash/issues/9215) or post in the [Logstash forum](https://discuss.elastic.co/c/logstash). diff --git a/docs/extend/java-output-plugin.md b/docs/extend/java-output-plugin.md new file mode 100644 index 000000000..e8e7a6040 --- /dev/null +++ b/docs/extend/java-output-plugin.md @@ -0,0 +1,311 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/java-output-plugin.html +--- + +# How to write a Java output plugin [java-output-plugin] + +To develop a new Java output for Logstash, you write a new Java class that conforms to the Logstash Java Outputs API, package it, and install it with the logstash-plugin utility. We’ll go through each of those steps. + + +## Set up your environment [_set_up_your_environment_4] + + +### Copy the example repo [_copy_the_example_repo_4] + +Start by copying the [example output plugin](https://github.com/logstash-plugins/logstash-output-java_output_example). The plugin API is currently part of the Logstash codebase so you must have a local copy of that available. You can obtain a copy of the Logstash codebase with the following `git` command: + +```shell +git clone --branch --single-branch https://github.com/elastic/logstash.git +``` + +The `branch_name` should correspond to the version of Logstash containing the preferred revision of the Java plugin API. + +::::{note} +The GA version of the Java plugin API is available in the `7.2` and later branches of the Logstash codebase. +:::: + + +Specify the `target_folder` for your local copy of the Logstash codebase. If you do not specify `target_folder`, it defaults to a new folder called `logstash` under your current folder. + + +### Generate the .jar file [_generate_the_jar_file_4] + +After you have obtained a copy of the appropriate revision of the Logstash codebase, you need to compile it to generate the .jar file containing the Java plugin API. From the root directory of your Logstash codebase ($LS_HOME), you can compile it with `./gradlew assemble` (or `gradlew.bat assemble` if you’re running on Windows). This should produce the `$LS_HOME/logstash-core/build/libs/logstash-core-x.y.z.jar` where `x`, `y`, and `z` refer to the version of Logstash. + +After you have successfully compiled Logstash, you need to tell your Java plugin where to find the `logstash-core-x.y.z.jar` file. Create a new file named `gradle.properties` in the root folder of your plugin project. That file should have a single line: + +```txt +LOGSTASH_CORE_PATH=/logstash-core +``` + +where `target_folder` is the root folder of your local copy of the Logstash codebase. + + +## Code the plugin [_code_the_plugin_4] + +The example output plugin prints events to the console using the event’s `toString` method. Let’s look at the main class in the example output: + +```java +@LogstashPlugin(name = "java_output_example") +public class JavaOutputExample implements Output { + + public static final PluginConfigSpec PREFIX_CONFIG = + PluginConfigSpec.stringSetting("prefix", ""); + + private final String id; + private String prefix; + private PrintStream printer; + private final CountDownLatch done = new CountDownLatch(1); + private volatile boolean stopped = false; + + public JavaOutputExample(final String id, final Configuration configuration, final Context context) { + this(id, configuration, context, System.out); + } + + JavaOutputExample(final String id, final Configuration config, final Context context, OutputStream targetStream) { + this.id = id; + prefix = config.get(PREFIX_CONFIG); + printer = new PrintStream(targetStream); + } + + @Override + public void output(final Collection events) { + Iterator z = events.iterator(); + while (z.hasNext() && !stopped) { + String s = prefix + z.next(); + printer.println(s); + } + } + + @Override + public void stop() { + stopped = true; + done.countDown(); + } + + @Override + public void awaitStop() throws InterruptedException { + done.await(); + } + + @Override + public Collection> configSchema() { + return Collections.singletonList(PREFIX_CONFIG); + } + + @Override + public String getId() { + return id; + } +} +``` + +Let’s step through and examine each part of that class. + + +### Class declaration [_class_declaration_8] + +```java +@LogstashPlugin(name="java_output_example") +public class JavaOutputExample implements Output { +``` + +Notes about the class declaration: + +* All Java plugins must be annotated with the `@LogstashPlugin` annotation. Additionally: + + * The `name` property of the annotation must be supplied and defines the name of the plugin as it will be used in the Logstash pipeline definition. For example, this output would be referenced in the output section of the Logstash pipeline definition as `output { java_output_example => { .... } }` + * The value of the `name` property must match the name of the class excluding casing and underscores. + +* The class must implement the `co.elastic.logstash.api.Output` interface. +* Java plugins may not be created in the `org.logstash` or `co.elastic.logstash` packages to prevent potential clashes with classes in Logstash itself. + + +### Plugin settings [_plugin_settings_4] + +The snippet below contains both the setting definition and the method referencing it: + +```java +public static final PluginConfigSpec PREFIX_CONFIG = + PluginConfigSpec.stringSetting("prefix", ""); + +@Override +public Collection> configSchema() { + return Collections.singletonList(PREFIX_CONFIG); +} +``` + +The `PluginConfigSpec` class allows developers to specify the settings that a plugin supports complete with setting name, data type, deprecation status, required status, and default value. In this example, the `prefix` setting defines an optional prefix to include in the output of the event. The setting is not required and if it is not explicitly set, it defaults to the empty string. + +The `configSchema` method must return a list of all settings that the plugin supports. In a future phase of the Java plugin project, the Logstash execution engine will validate that all required settings are present and that no unsupported settings are present. + + +### Constructor and initialization [_constructor_and_initialization_4] + +```java +private final String id; +private String prefix; +private PrintStream printer; + +public JavaOutputExample(final String id, final Configuration configuration, final Context context) { + this(configuration, context, System.out); +} + +JavaOutputExample(final String id, final Configuration config, final Context context, OutputStream targetStream) { + this.id = id; + prefix = config.get(PREFIX_CONFIG); + printer = new PrintStream(targetStream); +} +``` + +All Java output plugins must have a constructor taking a `String` id and a `Configuration` and `Context` argument. This is the constructor that will be used to instantiate them at runtime. The retrieval and validation of all plugin settings should occur in this constructor. In this example, the values of the `prefix` setting is retrieved and stored in a local variable for later use in the `output` method. In this example, a second, pacakge private constructor is defined that is useful for unit testing with a `Stream` other than `System.out`. + +Any additional initialization may occur in the constructor as well. If there are any unrecoverable errors encountered in the configuration or initialization of the output plugin, a descriptive exception should be thrown. The exception will be logged and will prevent Logstash from starting. + + +### Output method [_output_method] + +```java +@Override +public void output(final Collection events) { + Iterator z = events.iterator(); + while (z.hasNext() && !stopped) { + String s = prefix + z.next(); + printer.println(s); + } +} +``` + +Outputs may send events to local sinks such as the console or a file or to remote systems such as Elasticsearch or other external systems. In this example, the events are printed to the local console. + + +### Stop and awaitStop methods [_stop_and_awaitstop_methods_2] + +```java +private final CountDownLatch done = new CountDownLatch(1); +private volatile boolean stopped; + +@Override +public void stop() { + stopped = true; + done.countDown(); +} + +@Override +public void awaitStop() throws InterruptedException { + done.await(); +} +``` + +The `stop` method notifies the output to stop sending events. The stop mechanism may be implemented in any way that honors the API contract though a `volatile boolean` flag works well for many use cases. Because this output example is so simple, its `output` method does not check for the stop flag. + +Outputs stop both asynchronously and cooperatively. Use the `awaitStop` method to block until the output has completed the stop process. Note that this method should **not** signal the output to stop as the `stop` method does. The awaitStop mechanism may be implemented in any way that honors the API contract though a `CountDownLatch` works well for many use cases. + + +### getId method [_getid_method_4] + +```java +@Override +public String getId() { + return id; +} +``` + +For output plugins, the `getId` method should always return the id that was provided to the plugin through its constructor at instantiation time. + + +### Unit tests [_unit_tests_4] + +Lastly, but certainly not least importantly, unit tests are strongly encouraged. The example output plugin includes an [example unit test](https://github.com/logstash-plugins/logstash-output-java_output_example/blob/main/src/test/java/org/logstashplugins/JavaOutputExampleTest.java) that you can use as a template for your own. + + +## Package and deploy [_package_and_deploy_4] + +Java plugins are packaged as Ruby gems for dependency management and interoperability with Ruby plugins. Once they are packaged as gems, they may be installed with the `logstash-plugin` utility just as Ruby plugins are. Because no knowledge of Ruby or its toolchain should be required for Java plugin development, the procedure for packaging Java plugins as Ruby gems has been automated through a custom task in the Gradle build file provided with the example Java plugins. The following sections describe how to configure and execute that packaging task as well as how to install the packaged Java plugin in Logstash. + + +### Configuring the Gradle packaging task [_configuring_the_gradle_packaging_task_4] + +The following section appears near the top of the `build.gradle` file supplied with the example Java plugins: + +```java +// =========================================================================== +// plugin info +// =========================================================================== +group 'org.logstashplugins' // must match the package of the main plugin class +version "${file("VERSION").text.trim()}" // read from required VERSION file +description = "Example Java filter implementation" +pluginInfo.licenses = ['Apache-2.0'] // list of SPDX license IDs +pluginInfo.longDescription = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using \$LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" +pluginInfo.authors = ['Elasticsearch'] +pluginInfo.email = ['info@elastic.co'] +pluginInfo.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" +pluginInfo.pluginType = "filter" +pluginInfo.pluginClass = "JavaFilterExample" +pluginInfo.pluginName = "java_filter_example" +// =========================================================================== +``` + +You should configure the values above for your plugin. + +* The `version` value will be automatically read from the `VERSION` file in the root of your plugin’s codebase. +* `pluginInfo.pluginType` should be set to one of `input`, `filter`, `codec`, or `output`. +* `pluginInfo.pluginName` must match the name specified on the `@LogstashPlugin` annotation on the main plugin class. The Gradle packaging task will validate that and return an error if they do not match. + + +### Running the Gradle packaging task [_running_the_gradle_packaging_task_4] + +Several Ruby source files along with a `gemspec` file and a `Gemfile` are required to package the plugin as a Ruby gem. These Ruby files are used only for defining the Ruby gem structure or at Logstash startup time to register the Java plugin. They are not used during runtime event processing. The Gradle packaging task automatically generates all of these files based on the values configured in the section above. + +You run the Gradle packaging task with the following command: + +```shell +./gradlew gem +``` + +For Windows platforms: Substitute `gradlew.bat` for `./gradlew` as appropriate in the command. + +That task will produce a gem file in the root directory of your plugin’s codebase with the name `logstash-{{plugintype}}--.gem` + + +### Installing the Java plugin in Logstash [_installing_the_java_plugin_in_logstash_4] + +After you have packaged your Java plugin as a Ruby gem, you can install it in Logstash with this command: + +```shell +bin/logstash-plugin install --no-verify --local /path/to/javaPlugin.gem +``` + +For Windows platforms: Substitute backslashes for forward slashes as appropriate in the command. + + +## Running Logstash with the Java output plugin [_running_logstash_with_the_java_output_plugin] + +The following is a minimal Logstash configuration that can be used to test that the Java output plugin is correctly installed and functioning. + +```java +input { + generator { message => "Hello world!" count => 1 } +} +output { + java_output_example {} +} +``` + +Copy the above Logstash configuration to a file such as `java_output.conf`. Logstash should then be started with: + +```txt +bin/logstash -f /path/to/java_output.conf +``` + +The expected Logstash output (excluding initialization) with the configuration above is: + +```txt +{"@timestamp":"yyyy-MM-ddTHH:mm:ss.SSSZ","message":"Hello world!","@version":"1","host":"","sequence":0} +``` + + +## Feedback [_feedback_4] + +If you have any feedback on Java plugin support in Logstash, please comment on our [main Github issue](https://github.com/elastic/logstash/issues/9215) or post in the [Logstash forum](https://discuss.elastic.co/c/logstash). diff --git a/docs/extend/output-new-plugin.md b/docs/extend/output-new-plugin.md new file mode 100644 index 000000000..ab1929ff3 --- /dev/null +++ b/docs/extend/output-new-plugin.md @@ -0,0 +1,570 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/output-new-plugin.html +--- + +# How to write a Logstash output plugin [output-new-plugin] + +To develop a new output for Logstash, build a self-contained Ruby gem whose source code lives in its own GitHub repository. The Ruby gem can then be hosted and shared on RubyGems.org. You can use the example output implementation as a starting point. (If you’re unfamiliar with Ruby, you can find an excellent quickstart guide at [https://www.ruby-lang.org/en/documentation/quickstart/](https://www.ruby-lang.org/en/documentation/quickstart/).) + +## Get started [_get_started_4] + +Let’s step through creating an output plugin using the [example output plugin](https://github.com/logstash-plugins/logstash-output-example/). + +### Create a GitHub repo for your new plugin [_create_a_github_repo_for_your_new_plugin_4] + +Each Logstash plugin lives in its own GitHub repository. To create a new repository for your plugin: + +1. Log in to GitHub. +2. Click the **Repositories** tab. You’ll see a list of other repositories you’ve forked or contributed to. +3. Click the green **New** button in the upper right. +4. Specify the following settings for your new repo: + + * **Repository name** — a unique name of the form `logstash-output-pluginname`. + * **Public or Private** — your choice, but the repository must be Public if you want to submit it as an official plugin. + * **Initialize this repository with a README** — enables you to immediately clone the repository to your computer. + +5. Click **Create Repository**. + + +### Use the plugin generator tool [_use_the_plugin_generator_tool_4] + +You can create your own Logstash plugin in seconds! The `generate` subcommand of `bin/logstash-plugin` creates the foundation for a new Logstash plugin with templatized files. It creates the correct directory structure, gemspec files, and dependencies so you can start adding custom code to process data with Logstash. + +For more information, see [Generating plugins](/reference/plugin-generator.md) + + +### Copy the output code [_copy_the_output_code] + +Alternatively, you can use the examples repo we host on github.com + +1. **Clone your plugin.** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``output-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash``-output-MYPLUGINNAME.git` + + * `cd logstash-output-MYPLUGINNAME` + +2. **Clone the output plugin example and copy it to your plugin branch.** + + You don’t want to include the example .git directory or its contents, so delete it before you copy the example. + + * `cd /tmp` + * `git clone https://github.com/logstash-plugins/logstash``-output-example.git` + * `cd logstash-output-example` + * `rm -rf .git` + * `cp -R * /path/to/logstash-output-mypluginname/` + +3. **Rename the following files to match the name of your plugin.** + + * `logstash-output-example.gemspec` + * `example.rb` + * `example_spec.rb` + + ```txt + cd /path/to/logstash-output-mypluginname + mv logstash-output-example.gemspec logstash-output-mypluginname.gemspec + mv lib/logstash/outputs/example.rb lib/logstash/outputs/mypluginname.rb + mv spec/outputs/example_spec.rb spec/outputs/mypluginname_spec.rb + ``` + + +Your file structure should look like this: + +```txt +$ tree logstash-output-mypluginname +├── Gemfile +├── LICENSE +├── README.md +├── Rakefile +├── lib +│   └── logstash +│   └── outputs +│   └── mypluginname.rb +├── logstash-output-mypluginname.gemspec +└── spec + └── outputs + └── mypluginname_spec.rb +``` + +For more information about the Ruby gem file structure and an excellent walkthrough of the Ruby gem creation process, see [http://timelessrepo.com/making-ruby-gems](http://timelessrepo.com/making-ruby-gems) + + +### See what your plugin looks like [_see_what_your_plugin_looks_like_4] + +Before we dive into the details, open up the plugin file in your favorite text editor and take a look. + +```ruby +require "logstash/outputs/base" +require "logstash/namespace" + +# Add any asciidoc formatted documentation here +# An example output that does nothing. +class LogStash::Outputs::Example < LogStash::Outputs::Base + config_name "example" + + # This sets the concurrency behavior of this plugin. By default it is :legacy, which was the standard + # way concurrency worked before Logstash 2.4 + # + # You should explicitly set it to either :single or :shared as :legacy will be removed in Logstash 6.0 + # + # When configured as :single a single instance of the Output will be shared among the + # pipeline worker threads. Access to the `#multi_receive/#multi_receive_encoded/#receive` method will be synchronized + # i.e. only one thread will be active at a time making threadsafety much simpler. + # + # You can set this to :shared if your output is threadsafe. This will maximize + # concurrency but you will need to make appropriate uses of mutexes in `#multi_receive/#receive`. + # + # Only the `#multi_receive/#multi_receive_encoded` methods need to actually be threadsafe, the other methods + # will only be executed in a single thread + concurrency :single + + public + def register + end # def register + + public + # Takes an array of events + # Must be threadsafe if `concurrency :shared` is set + def multi_receive(events) + end # def multi_receive +end # class LogStash::Outputs::Example +``` + + + +## Coding output plugins [_coding_output_plugins] + +Now let’s take a line-by-line look at the example plugin. + +### `require` Statements [_require_statements_4] + +Logstash output plugins require parent classes defined in `logstash/outputs/base` and logstash/namespace: + +```ruby +require "logstash/outputs/base" +require "logstash/namespace" +``` + +Of course, the plugin you build may depend on other code, or even gems. Just put them here along with these Logstash dependencies. + + + +## Plugin Body [_plugin_body_4] + +Let’s go through the various elements of the plugin itself. + +### `class` Declaration [_class_declaration_4] + +The output plugin class should be a subclass of `LogStash::Outputs::Base`: + +```ruby +class LogStash::Outputs::Example < LogStash::Outputs::Base +``` + +The class name should closely mirror the plugin name, for example: + +```ruby +LogStash::Outputs::Example +``` + + +### `config_name` [_config_name_4] + +```ruby + config_name "example" +``` + +This is the name your plugin will call inside the output configuration block. + +If you set `config_name "example"` in your plugin code, the corresponding Logstash configuration block would need to look like this: + + + +## Configuration Parameters [_configuration_parameters_4] + +```ruby + config :variable_name, :validate => :variable_type, :default => "Default value", :required => boolean, :deprecated => boolean, :obsolete => string +``` + +The configuration, or `config` section allows you to define as many (or as few) parameters as are needed to enable Logstash to process events. + +There are several configuration attributes: + +* `:validate` - allows you to enforce passing a particular data type to Logstash for this configuration option, such as `:string`, `:password`, `:boolean`, `:number`, `:array`, `:hash`, `:path` (a file-system path), `uri`, `:codec` (since 1.2.0), `:bytes`. Note that this also works as a coercion in that if I specify "true" for boolean (even though technically a string), it will become a valid boolean in the config. This coercion works for the `:number` type as well where "1.2" becomes a float and "22" is an integer. +* `:default` - lets you specify a default value for a parameter +* `:required` - whether or not this parameter is mandatory (a Boolean `true` or +* `:list` - whether or not this value should be a list of values. Will typecheck the list members, and convert scalars to one element lists. Note that this mostly obviates the array type, though if you need lists of complex objects that will be more suitable. `false`) +* `:deprecated` - informational (also a Boolean `true` or `false`) +* `:obsolete` - used to declare that a given setting has been removed and is no longer functioning. The idea is to provide an informed upgrade path to users who are still using a now-removed setting. + + +## Plugin Methods [_plugin_methods_4] + +Logstash outputs must implement the `register` and `multi_receive` methods. + +### `register` Method [_register_method_4] + +```ruby + public + def register + end # def register +``` + +The Logstash `register` method is like an `initialize` method. It was originally created to enforce having `super` called, preventing headaches for newbies. (Note: It may go away in favor of `initialize`, in conjunction with some enforced testing to ensure `super` is called.) + +`public` means the method can be called anywhere, not just within the class. This is the default behavior for methods in Ruby, but it is specified explicitly here anyway. + +You can also assign instance variables here (variables prepended by `@`). Configuration variables are now in scope as instance variables, like `@message` + + + +## Building the Plugin [_building_the_plugin_4] + +At this point in the process you have coded your plugin and are ready to build a Ruby Gem from it. The following information will help you complete the process. + +### External dependencies [_external_dependencies_4] + +A `require` statement in Ruby is used to include necessary code. In some cases your plugin may require additional files. For example, the collectd plugin [uses](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/lib/logstash/codecs/collectd.rb#L148) the `types.db` file provided by collectd. In the main directory of your plugin, a file called `vendor.json` is where these files are described. + +The `vendor.json` file contains an array of JSON objects, each describing a file dependency. This example comes from the [collectd](https://github.com/logstash-plugins/logstash-codec-collectd/blob/main/vendor.json) codec plugin: + +```txt +[{ + "sha1": "a90fe6cc53b76b7bdd56dc57950d90787cb9c96e", + "url": "http://collectd.org/files/collectd-5.4.0.tar.gz", + "files": [ "/src/types.db" ] +}] +``` + +* `sha1` is the sha1 signature used to verify the integrity of the file referenced by `url`. +* `url` is the address from where Logstash will download the file. +* `files` is an optional array of files to extract from the downloaded file. Note that while tar archives can use absolute or relative paths, treat them as absolute in this array. If `files` is not present, all files will be uncompressed and extracted into the vendor directory. + +Another example of the `vendor.json` file is the [`geoip` filter](https://github.com/logstash-plugins/logstash-filter-geoip/blob/main/vendor.json) + +The process used to download these dependencies is to call `rake vendor`. This will be discussed further in the testing section of this document. + +Another kind of external dependency is on jar files. This will be described in the "Add a `gemspec` file" section. + + +### Deprecated features [_deprecated_features_4] + +As a plugin evolves, an option or feature may no longer serve the intended purpose, and the developer may want to *deprecate* its usage. Deprecation warns users about the option’s status, so they aren’t caught by surprise when it is removed in a later release. + +{{ls}} 7.6 introduced a *deprecation logger* to make handling those situations easier. You can use the [adapter](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support) to ensure that your plugin can use the deprecation logger while still supporting older versions of {{ls}}. See the [readme](https://github.com/logstash-plugins/logstash-mixin-deprecation_logger_support/blob/main/README.md) for more information and for instructions on using the adapter. + +Deprecations are noted in the `logstash-deprecation.log` file in the `log` directory. + + +### Add a Gemfile [_add_a_gemfile_4] + +Gemfiles allow Ruby’s Bundler to maintain the dependencies for your plugin. Currently, all we’ll need is the Logstash gem, for testing, but if you require other gems, you should add them in here. + +::::{tip} +See [Bundler’s Gemfile page](http://bundler.io/gemfile.html) for more details. +:::: + + +```ruby +source 'https://rubygems.org' +gemspec +gem "logstash", :github => "elastic/logstash", :branch => "master" +``` + + + +## Add a `gemspec` file [_add_a_gemspec_file_4] + +Gemspecs define the Ruby gem which will be built and contain your plugin. + +::::{tip} +More information can be found on the [Rubygems Specification page](http://guides.rubygems.org/specification-reference/). +:::: + + +```ruby +Gem::Specification.new do |s| + s.name = 'logstash-output-example' + s.version = '0.1.0' + s.licenses = ['Apache License (2.0)'] + s.summary = "This output does x, y, z in Logstash" + s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" + s.authors = ["Elastic"] + s.email = 'info@elastic.co' + s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" + s.require_paths = ["lib"] + + # Files + s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT'] + # Tests + s.test_files = s.files.grep(%r{^(test|spec|features)/}) + + # Special flag to let us know this is actually a logstash plugin + s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" } + + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +end +``` + +It is appropriate to change these values to fit your plugin. In particular, `s.name` and `s.summary` should reflect your plugin’s name and behavior. + +`s.licenses` and `s.version` are also important and will come into play when you are ready to publish your plugin. + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elastic/logstash/blob/main/LICENSE.txt). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + +The gem version, designated by `s.version`, helps track changes to plugins over time. You should use [semver versioning](http://semver.org/) strategy for version numbers. + +### Runtime and Development Dependencies [_runtime_and_development_dependencies_4] + +At the bottom of the `gemspec` file is a section with a comment: `Gem dependencies`. This is where any other needed gems must be mentioned. If a gem is necessary for your plugin to function, it is a runtime dependency. If a gem are only used for testing, then it would be a development dependency. + +::::{note} +You can also have versioning requirements for your dependencies—​including other Logstash plugins: + +```ruby + # Gem dependencies + s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" + s.add_development_dependency 'logstash-devutils' +``` + +This gemspec has a runtime dependency on the logstash-core-plugin-api and requires that it have a version number greater than or equal to version 1.60 and less than or equal to version 2.99. + +:::: + + +::::{important} +All plugins have a runtime dependency on the `logstash-core-plugin-api` gem, and a development dependency on `logstash-devutils`. +:::: + + + +### Jar dependencies [_jar_dependencies_4] + +In some cases, such as the [Elasticsearch output plugin](https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/main/logstash-output-elasticsearch.gemspec#L22-L23), your code may depend on a jar file. In cases such as this, the dependency is added in the gemspec file in this manner: + +```ruby + # Jar dependencies + s.requirements << "jar 'org.elasticsearch:elasticsearch', '5.0.0'" + s.add_runtime_dependency 'jar-dependencies' +``` + +With these both defined, the install process will search for the required jar file at [http://mvnrepository.com](http://mvnrepository.com) and download the specified version. + + + +## Document your plugin [_document_your_plugin_4] + +Documentation is an important part of your plugin. All plugin documentation is rendered and placed in the [Logstash Reference](/reference/index.md) and the [Versioned plugin docs](logstash-docs-md://vpr/integration-plugins.md). + +See [Document your plugin](/extend/plugin-doc.md) for tips and guidelines. + + +## Add Tests [_add_tests_4] + +Logstash loves tests. Lots of tests. If you’re using your new output plugin in a production environment, you’ll want to have some tests to ensure you are not breaking any existing functionality. + +::::{note} +A full exposition on RSpec is outside the scope of this document. Learn more about RSpec at [http://rspec.info](http://rspec.info) +:::: + + +For help learning about tests and testing, look in the `spec/outputs/` directory of several other similar plugins. + + +## Clone and test! [_clone_and_test_4] + +Now let’s start with a fresh clone of the plugin, build it and run the tests. + +* **Clone your plugin into a temporary location** Replace `GITUSERNAME` with your github username, and `MYPLUGINNAME` with your plugin name. + + * `git clone https://github.com/GITUSERNAME/logstash-``output-MYPLUGINNAME.git` + + * alternately, via ssh: `git clone git@github.com:GITUSERNAME/logstash-``output-MYPLUGINNAME.git` + + * `cd logstash-output-MYPLUGINNAME` + + +Then, you’ll need to install your plugins dependencies with bundler: + +``` +bundle install +``` + +::::{important} +If your plugin has an external file dependency described in `vendor.json`, you must download that dependency before running or testing. You can do this by running: + +``` +rake vendor +``` + +:::: + + +And finally, run the tests: + +``` +bundle exec rspec +``` + +You should see a success message, which looks something like this: + +``` +Finished in 0.034 seconds +1 example, 0 failures +``` + +Hooray! You’re almost there! (Unless you saw failures…​ you should fix those first). + + +## Building and Testing [_building_and_testing_4] + +Now you’re ready to build your (well-tested) plugin into a Ruby gem. + +### Build [_build_4] + +You already have all the necessary ingredients, so let’s go ahead and run the build command: + +```sh +gem build logstash-output-example.gemspec +``` + +That’s it! Your gem should be built and be in the same path with the name + +```sh +logstash-output-mypluginname-0.1.0.gem +``` + +The `s.version` number from your gemspec file will provide the gem version, in this case, `0.1.0`. + + +### Test installation [_test_installation_4] + +You should test install your plugin into a clean installation of Logstash. Download the latest version from the [Logstash downloads page](https://www.elastic.co/downloads/logstash/). + +1. Untar and cd in to the directory: + + ```sh + curl -O https://download.elastic.co/logstash/logstash/logstash-9.0.0.tar.gz + tar xzvf logstash-9.0.0.tar.gz + cd logstash-9.0.0 + ``` + +2. Using the plugin tool, we can install the gem we just built. + + * Replace `/my/logstash/plugins` with the correct path to the gem for your environment, and `0.1.0` with the correct version number from the gemspec file. + + ```sh + bin/logstash-plugin install /my/logstash/plugins/logstash-output-example/logstash-output-example-0.1.0.gem + ``` + + * After running this, you should see feedback from Logstash that it was successfully installed: + + ```sh + validating /my/logstash/plugins/logstash-output-example/logstash-output-example-0.1.0.gem >= 0 + Valid logstash plugin. Continuing... + Successfully installed 'logstash-output-example' with version '0.1.0' + ``` + + ::::{tip} + You can also use the Logstash plugin tool to determine which plugins are currently available: + + ```sh + bin/logstash-plugin list + ``` + + Depending on what you have installed, you might see a short or long list of plugins: inputs, codecs, filters and outputs. + + :::: + +3. Now try running Logstash with a simple configuration passed in via the command-line, using the `-e` flag. + + ::::{note} + Your results will depend on what your output plugin is designed to do. + :::: + + +Congratulations! You’ve built, deployed and successfully run a Logstash output. + + + +## Submitting your plugin to [RubyGems.org](http://rubygems.org) and [logstash-plugins](https://github.com/logstash-plugins) [_submitting_your_plugin_to_rubygems_orghttprubygems_org_and_logstash_pluginshttpsgithub_comlogstash_plugins_4] + +Logstash uses [RubyGems.org](http://rubygems.org) as its repository for all plugin artifacts. Once you have developed your new plugin, you can make it available to Logstash users by simply publishing it to RubyGems.org. + +### Licensing [_licensing_4] + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elasticsearch/logstash/blob/main/LICENSE). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + + +### Publishing to [RubyGems.org](http://rubygems.org) [_publishing_to_rubygems_orghttprubygems_org_4] + +To begin, you’ll need an account on RubyGems.org + +* [Sign-up for a RubyGems account](https://rubygems.org/sign_up). + +After creating an account, [obtain](http://guides.rubygems.org/rubygems-org-api/#api-authorization) an API key from RubyGems.org. By default, RubyGems uses the file `~/.gem/credentials` to store your API key. These credentials will be used to publish the gem. Replace `username` and `password` with the credentials you created at RubyGems.org: + +```sh +curl -u username:password https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials +chmod 0600 ~/.gem/credentials +``` + +Before proceeding, make sure you have the right version in your gemspec file and commit your changes. + +* `s.version = '0.1.0'` + +To publish version 0.1.0 of your new logstash gem: + +```sh +bundle install +bundle exec rake vendor +bundle exec rspec +bundle exec rake publish_gem +``` + +::::{note} +Executing `rake publish_gem`: + +1. Reads the version from the gemspec file (`s.version = '0.1.0'`) +2. Checks in your local repository if a tag exists for that version. If the tag already exists, it aborts the process. Otherwise, it creates a new version tag in your local repository. +3. Builds the gem +4. Publishes the gem to RubyGems.org + +:::: + + +That’s it! Your plugin is published! Logstash users can now install your plugin by running: + +```sh +bin/logstash-plugin install logstash-output-mypluginname +``` + + + +## Contributing your source code to [logstash-plugins](https://github.com/logstash-plugins) [_contributing_your_source_code_to_logstash_pluginshttpsgithub_comlogstash_plugins_4] + +It is not required to contribute your source code to [logstash-plugins](https://github.com/logstash-plugins) github organization, but we always welcome new plugins! + +### Benefits [_benefits_4] + +Some of the many benefits of having your plugin in the logstash-plugins repository are: + +* **Discovery.** Your plugin will appear in the [Logstash Reference](/reference/index.md), where Logstash users look first for plugins and documentation. +* **Documentation.** Your plugin documentation will automatically be added to the [Logstash Reference](/reference/index.md). +* **Testing.** With our testing infrastructure, your plugin will be continuously tested against current and future releases of Logstash. As a result, users will have the assurance that if incompatibilities arise, they will be quickly discovered and corrected. + + +### Acceptance Guidelines [_acceptance_guidelines_4] + +* **Code Review.** Your plugin must be reviewed by members of the community for coherence, quality, readability, stability and security. +* **Tests.** Your plugin must contain tests to be accepted. These tests are also subject to code review for scope and completeness. It’s ok if you don’t know how to write tests — we will guide you. We are working on publishing a guide to creating tests for Logstash which will make it easier. In the meantime, you can refer to [http://betterspecs.org/](http://betterspecs.org/) for examples. + +To begin migrating your plugin to logstash-plugins, simply create a new [issue](https://github.com/elasticsearch/logstash/issues) in the Logstash repository. When the acceptance guidelines are completed, we will facilitate the move to the logstash-plugins organization using the recommended [github process](https://help.github.com/articles/transferring-a-repository/#transferring-from-a-user-to-an-organization). diff --git a/docs/extend/plugin-doc.md b/docs/extend/plugin-doc.md new file mode 100644 index 000000000..67658bfae --- /dev/null +++ b/docs/extend/plugin-doc.md @@ -0,0 +1,172 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/plugin-doc.html +--- + +# Document your plugin [plugin-doc] + +Documentation is a required component of your plugin. Quality documentation with good examples contributes to the adoption of your plugin. + +The documentation that you write for your plugin will be generated and published in the [Logstash Reference](/reference/index.md) and the [Logstash Versioned Plugin Reference](logstash-docs-md://vpr/integration-plugins.md). + +::::{admonition} Plugin listing in {{ls}} Reference +:class: note + +We may list your plugin in the [Logstash Reference](/reference/index.md) if it meets our [requirements and quality standards](/extend/index.md#plugin-acceptance). When we list your plugin, we point to *your* documentation—​a readme.md, docs/index.asciidoc, or both—​in your plugin repo. For more info on this option, see [List your plugin](/extend/plugin-listing.md). + +:::: + + +The following sections contain guidelines for documenting plugins hosted in the Github [logstash-plugins](https://github.com/logstash-plugins/) organization. + +## Documentation file [plugin-doc-file] + +Documentation belongs in a single file called *docs/index.asciidoc*. It belongs in a single file called *docs/index.asciidoc*. The [plugin generation utility](/reference/plugin-generator.md) creates a starter file for you. + + +## Heading IDs [heading-ids] + +Format heading anchors with variables that can support generated IDs. This approach creates unique IDs when the [Logstash Versioned Plugin Reference](logstash-docs-md://vpr/integration-plugins.md) is built. Unique heading IDs are required to avoid duplication over multiple versions of a plugin. + +**Example** + +Don’t hardcode a plugin heading ID like this: `[[config_models]]` + +Instead, use variables to define it: + +```txt +[id="plugins-{type}s-{plugin}-config_models"] +==== Configuration models +``` + +If you hardcode an ID, the [Logstash Versioned Plugin Reference](logstash-docs-md://vpr/integration-plugins.md) builds correctly the first time. The second time the doc build runs, the ID is flagged as a duplicate, and the build fails. + + +## Link formats [link-format] + +Correct link formatting is essential for directing users to the content you want them to see. Incorrect link formatting or duplicate links can break the documentation build. Let’s not do that. + +### Link to content in the same file [_link_to_content_in_the_same_file] + +Use angle brackets to format links to content in the same asciidoc file. + +**Example** + +This link: + +```txt +<> +``` + +Points to this heading in the same file: + +```txt +[id="plugins-{type}s-{plugin}-config_models"] +==== Configuration models +``` + + +### Link to content in the Logstash Reference Guide [_link_to_content_in_the_logstash_reference_guide] + +Use external link syntax for links that point to documentation for other plugins or content in the Logstash Reference Guide. + +**Examples** + +```txt +{logstash-ref}/plugins-codecs-multiline.html[Multiline codec plugin] +``` + +```txt +{logstash-ref}/getting-started-with-logstash.html +``` + + +### Link text [_link_text] + +If you don’t specify link text, the URL is used as the link text. + +**Examples** + +If you want your link to display as {{logstash-ref}}/getting-started-with-logstash.html, use this format: + +```txt +{logstash-ref}/getting-started-with-logstash.html +``` + +If you want your link to display as [Getting Started with Logstash](/reference/getting-started-with-logstash.md), use this format: + +```txt +{logstash-ref}/getting-started-with-logstash.html[Getting Started with Logstash] +``` + + +### Link to data type descriptions [_link_to_data_type_descriptions] + +We make an exception for links that point to data type descriptions, such as `<>`, because they are used so frequently. We have a cleanup step in the conversion script that converts the links to the correct syntax. + + + +## Code samples [format-code] + +We all love code samples. Asciidoc supports code blocks and config examples. To include Ruby code, use the asciidoc `[source,ruby]` directive. + +Note that the hashmarks (#) are present to make the example render correctly. Don’t include the hashmarks in your asciidoc file. + +```txt +# [source,ruby] +# ----- +# match => { +# "field1" => "value1" +# "field2" => "value2" +# ... +# } +# ----- +``` + +The sample above (with hashmarks removed) renders in the documentation like this: + +```ruby +match => { + "field1" => "value1" + "field2" => "value2" + ... +} +``` + + +## Where’s my doc? [_wheres_my_doc] + +Plugin documentation goes through several steps before it gets published in the [Logstash Versioned Plugin Reference](logstash-docs-md://vpr/integration-plugins.md) and the [Logstash Reference](/reference/index.md). + +Here’s an overview of the workflow: + +* Be sure that you have signed the contributor license agreement (CLA) and have all necessary approvals and sign offs. +* Merge the pull request for your plugin (including the `index.asciidoc` file, the `changelog.md` file, and the gemspec). +* Wait for the continuous integration build to complete successfully. +* Publish the plugin to [https://rubygems.org](https://rubygems.org). +* A script detects the new or changed version, and picks up the `index.asciidoc` file for inclusion in the doc build. +* The documentation for your new plugin is published in the [Logstash Versioned Plugin Reference](logstash-docs-md://vpr/integration-plugins.md). + +We’re not done yet. + +* For each release, we package the new and changed documentation files into a pull request to add or update content. (We sometimes package plugin docs between releases if we make significant changes to plugin documentation or add a new plugin.) +* The script detects the new or changed version, and picks up the `index.asciidoc` file for inclusion in the doc build. +* We create a pull request, and merge the new and changed content into the appropriate version branches. +* For a new plugin, we add a link to the list of plugins in the [Logstash Reference](/reference/index.md). +* The documentation for your new (or changed) plugin is published in the [Logstash Reference](/reference/index.md). + +### Documentation or plugin updates [_documentation_or_plugin_updates] + +When you make updates to your plugin or the documentation, consider bumping the version number in the changelog and gemspec (or version file). The version change triggers the doc build to pick up your changes for publishing. + + + +## Resources [_resources] + +For more asciidoc formatting tips, see the excellent reference at [https://github.com/elastic/docs#asciidoc-guide](https://github.com/elastic/docs#asciidoc-guide). + +For tips on contributing and changelog guidelines, see [CONTRIBUTING.md](https://github.com/elastic/logstash/blob/main/CONTRIBUTING.md#logstash-plugin-changelog-guidelines). + +For general information about contributing, see [Contributing to Logstash](/extend/index.md). + + diff --git a/docs/extend/plugin-listing.md b/docs/extend/plugin-listing.md new file mode 100644 index 000000000..48807a404 --- /dev/null +++ b/docs/extend/plugin-listing.md @@ -0,0 +1,23 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/plugin-listing.html +--- + +# List your plugin [plugin-listing] + +The [Logstash Reference](/reference/index.md) is the first place {{ls}} users look for plugins and documentation. If your plugin meets the [quality and acceptance guidelines](/extend/index.md#plugin-acceptance), we may be able to list it in the guide. + +The plugin source and documentation will continue to live in your repo, and we will direct users there. + +If you would like to have your plugin included in the [Logstash Reference](/reference/index.md), create a new [issue](https://github.com/elasticsearch/logstash/issues) in the Logstash repository with the following information: + +* Title: `PluginListing: ` +* Body: + + * Brief description of the plugin (what it is and what it does). + * Link to the plugin repository. + * Link to the README.md or docs/index.asciidoc. + * Describe how your plugin meets our [quality and acceptance guidelines](/extend/index.md#plugin-acceptance). + +* Labels: `docs`, `new-plugin` + diff --git a/docs/extend/publish-plugin.md b/docs/extend/publish-plugin.md new file mode 100644 index 000000000..13294b2b5 --- /dev/null +++ b/docs/extend/publish-plugin.md @@ -0,0 +1,62 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/publish-plugin.html +--- + +# Publish your plugin to RubyGems.org [publish-plugin] + +Logstash uses [RubyGems.org](http://rubygems.org) as its repository for all plugin artifacts. After you have developed your new plugin, you can make it available to Logstash users by publishing it to RubyGems.org. + +## Licensing [_licensing_5] + +Logstash and all its plugins are licensed under [Apache License, version 2 ("ALv2")](https://github.com/elasticsearch/logstash/blob/main/LICENSE). If you make your plugin publicly available via [RubyGems.org](http://rubygems.org), please make sure to have this line in your gemspec: + +* `s.licenses = ['Apache License (2.0)']` + + +## Publish to [RubyGems.org](http://rubygems.org) [_publish_to_rubygems_orghttprubygems_org] + +You’ll need an account on RubyGems.org + +* [Sign-up for a RubyGems account](https://rubygems.org/sign_up). + +After creating an account, [obtain](http://guides.rubygems.org/rubygems-org-api/#api-authorization) an API key from RubyGems.org. By default, RubyGems uses the file `~/.gem/credentials` to store your API key. These credentials will be used to publish the gem. Replace `username` and `password` with the credentials you created at RubyGems.org: + +```sh +curl -u username:password https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials +chmod 0600 ~/.gem/credentials +``` + +Before proceeding, make sure you have the right version in your gemspec file and commit your changes. + +* `s.version = '0.1.0'` + +To publish version 0.1.0 of your new logstash gem: + +```sh +bundle install +bundle exec rake vendor +bundle exec rspec +bundle exec rake publish_gem +``` + +::::{note} +Execute `rake publish_gem`: + +1. Reads the version from the gemspec file (`s.version = '0.1.0'`) +2. Checks in your local repository if a tag exists for that version. If the tag already exists, it aborts the process. Otherwise, it creates a new version tag in your local repository. +3. Builds the gem +4. Publishes the gem to RubyGems.org + +:::: + + +That’s it! Your plugin is published! Logstash users can now install your plugin by running: + +```sh +bin/plugin install logstash-output-mypluginname +``` + +Where is `input`, `output`, `filter`, or `codec`, and is the name of your new plugin. + + diff --git a/docs/extend/toc.yml b/docs/extend/toc.yml new file mode 100644 index 000000000..225f36590 --- /dev/null +++ b/docs/extend/toc.yml @@ -0,0 +1,18 @@ +toc: + - file: index.md + - file: input-new-plugin.md + - file: codec-new-plugin.md + - file: filter-new-plugin.md + - file: output-new-plugin.md + - file: community-maintainer.md + - file: plugin-doc.md + - file: publish-plugin.md + - file: plugin-listing.md + - file: contributing-patch-plugin.md + - file: contribute-to-core.md + - file: create-logstash-plugins.md + children: + - file: java-input-plugin.md + - file: java-codec-plugin.md + - file: java-filter-plugin.md + - file: java-output-plugin.md \ No newline at end of file diff --git a/docs/gs-index.asciidoc b/docs/gs-index.asciidoc deleted file mode 100644 index feec48b87..000000000 --- a/docs/gs-index.asciidoc +++ /dev/null @@ -1,38 +0,0 @@ -[[logstash-reference]] -= Logstash Reference - -:branch: 5.4 -:major-version: 5.4 -:logstash_version: 5.4.0 -:elasticsearch_version: 5.4.0 -:docker-image: docker.elastic.co/logstash/logstash:{logstash_version} - -////////// -release-state can be: released | prerelease | unreleased -////////// -:release-state: released - -:jdk: 1.8.0 -:guide: https://www.elastic.co/guide/en/elasticsearch/guide/current/ -:ref: https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/ -:xpack: https://www.elastic.co/guide/en/x-pack/{branch}/ -:logstash: https://www.elastic.co/guide/en/logstash/{branch}/ -:filebeat: https://www.elastic.co/guide/en/beats/filebeat/{branch}/ -:lsissue: https://github.com/elastic/logstash/issues/ -:security: X-Pack Security - -[[introduction]] -== Logstash Introduction - -Logstash is an open source data collection engine with real-time pipelining capabilities. Logstash can dynamically -unify data from disparate sources and normalize the data into destinations of your choice. Cleanse and democratize all -your data for diverse advanced downstream analytics and visualization use cases. - -While Logstash originally drove innovation in log collection, its capabilities extend well beyond that use case. Any -type of event can be enriched and transformed with a broad array of input, filter, and output plugins, with many -native codecs further simplifying the ingestion process. Logstash accelerates your insights by harnessing a greater -volume and variety of data. - -include::static/introduction.asciidoc[] - -include::static/getting-started-with-logstash.asciidoc[] \ No newline at end of file diff --git a/docs/include/attributes-ls.asciidoc b/docs/include/attributes-ls.asciidoc deleted file mode 100644 index 714982cad..000000000 --- a/docs/include/attributes-ls.asciidoc +++ /dev/null @@ -1,10 +0,0 @@ -///// -These settings control attributes for Logstash core content -in the Logstash Reference (LSR) only. - -Shared attributes for the plugin docs (in the LSR and VPR) should -go in /docs/include/attributes-lsplugins.asciidoc instead -with a corresponding change to the VPR settings in -logstash-docs/docs/versioned-plugins/include/attributes-ls-vpr.asciidoc -///// - diff --git a/docs/include/attributes-lsplugins.asciidoc b/docs/include/attributes-lsplugins.asciidoc deleted file mode 100644 index 674bcc03c..000000000 --- a/docs/include/attributes-lsplugins.asciidoc +++ /dev/null @@ -1,13 +0,0 @@ -///// -These settings control attributes in the LSR only. -They correspond to the VPR settings in logstash-docs/docs/versioned-plugins/include/attributes-ls-vpr.asciidoc -When we update one, we must update settings in the other location, - -Attribute text formatted without hard wrap is deliberate. -Otherwise, text breaks at return and content after the return is dropped. - -Text is written to accommodate multiple versions because plugins are not stack versioned. -///// - - -:ecs-default: When the `ecs_compatibility` option for this plugin is not explicitly set, its effective value depends on the `pipeline.ecs_compatibility` setting for the pipeline in `pipelines.yml`, or globally in {logstash-ref}/logstash-settings-file.html[`logstash.yml`], allowing you to specify your preferred behavior at the plugin, pipeline, or system level. If no preference is specified, the default value is `v8` for Logstash 8 or `disabled` for all earlier releases of Logstash. For more information about ECS compatibility settings in Logstash and plugins, see {logstash-ref}/ecs-ls.html[ECS in Logstash]. diff --git a/docs/include/filter.asciidoc b/docs/include/filter.asciidoc deleted file mode 100644 index 23035490f..000000000 --- a/docs/include/filter.asciidoc +++ /dev/null @@ -1,234 +0,0 @@ -==== Common Options - -// Contributors: You must conditionally code all internal links and IDs in this -// file to make the common files work in both the LS Reference and the versioned -// plugin docs - -The following configuration options are supported by all filter plugins: - -ifeval::["{versioned_docs}"!="true"] -[cols="<,<,<",options="header",] -|======================================================================= -|Setting |Input type|Required -| <> |{logstash-ref}/configuration-file-structure.html#hash[hash]|No -| <> |{logstash-ref}/configuration-file-structure.html#array[array]|No -| <> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <> |{logstash-ref}/configuration-file-structure.html#string[string]|No -| <> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <> |{logstash-ref}/configuration-file-structure.html#array[array]|No -| <> |{logstash-ref}/configuration-file-structure.html#array[array]|No -|======================================================================= -endif::[] -ifeval::["{versioned_docs}"=="true"] -[cols="<,<,<",options="header",] -|======================================================================= -|Setting |Input type|Required -| <<{version}-plugins-{type}s-{plugin}-add_field>> |{logstash-ref}/configuration-file-structure.html#hash[hash]|No -| <<{version}-plugins-{type}s-{plugin}-add_tag>> |{logstash-ref}/configuration-file-structure.html#array[array]|No -| <<{version}-plugins-{type}s-{plugin}-enable_metric>> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <<{version}-plugins-{type}s-{plugin}-id>> |{logstash-ref}/configuration-file-structure.html#string[string]|No -| <<{version}-plugins-{type}s-{plugin}-periodic_flush>> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <<{version}-plugins-{type}s-{plugin}-remove_field>> |{logstash-ref}/configuration-file-structure.html#array[array]|No -| <<{version}-plugins-{type}s-{plugin}-remove_tag>> |{logstash-ref}/configuration-file-structure.html#array[array]|No -|======================================================================= -endif::[] - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-add_field"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-add_field"] -endif::[] -===== `add_field` - - * Value type is {logstash-ref}/configuration-file-structure.html#hash[hash] - * Default value is `{}` - -If this filter is successful, add any arbitrary fields to this event. -Field names can be dynamic and include parts of the event using the `%{field}`. - -Example: - -["source","json",subs="attributes"] - filter { - {plugin} { - add_field => { "foo_%\{somefield\}" => "Hello world, from %\{host\}" } - } - } - -["source","json",subs="attributes"] - # You can also add multiple fields at once: - filter { - {plugin} { - add_field => { - "foo_%\{somefield\}" => "Hello world, from %\{host\}" - "new_field" => "new_static_value" - } - } - } - -If the event has field `"somefield" == "hello"` this filter, on success, -would add field `foo_hello` if it is present, with the -value above and the `%{host}` piece replaced with that value from the -event. The second example would also add a hardcoded field. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-add_tag"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-add_tag"] -endif::[] -===== `add_tag` - - * Value type is {logstash-ref}/configuration-file-structure.html#array[array] - * Default value is `[]` - -If this filter is successful, add arbitrary tags to the event. -Tags can be dynamic and include parts of the event using the `%{field}` -syntax. - -Example: - -["source","json",subs="attributes"] - filter { - {plugin} { - add_tag => [ "foo_%\{somefield\}" ] - } - } - -["source","json",subs="attributes"] - # You can also add multiple tags at once: - filter { - {plugin} { - add_tag => [ "foo_%\{somefield\}", "taggedy_tag"] - } - } - -If the event has field `"somefield" == "hello"` this filter, on success, -would add a tag `foo_hello` (and the second example would of course add a `taggedy_tag` tag). - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-enable_metric"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-enable_metric"] -endif::[] -===== `enable_metric` - - * Value type is {logstash-ref}/configuration-file-structure.html#boolean[boolean] - * Default value is `true` - -Disable or enable metric logging for this specific plugin instance. -By default we record all the metrics we can, but you can disable metrics collection -for a specific plugin. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-id"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-id"] -endif::[] -===== `id` - - * Value type is {logstash-ref}/configuration-file-structure.html#string[string] - * There is no default value for this setting. - -Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one. -It is strongly recommended to set this ID in your configuration. This is particularly useful -when you have two or more plugins of the same type, for example, if you have 2 {plugin} filters. -Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs. - - -["source","json",subs="attributes"] - filter { - {plugin} { - id => "ABC" - } - } - -NOTE: Variable substitution in the `id` field only supports environment variables - and does not support the use of values from the secret store. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-periodic_flush"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-periodic_flush"] -endif::[] -===== `periodic_flush` - - * Value type is {logstash-ref}/configuration-file-structure.html#boolean[boolean] - * Default value is `false` - -Call the filter flush method at regular interval. -Optional. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-remove_field"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-remove_field"] -endif::[] -===== `remove_field` - - * Value type is {logstash-ref}/configuration-file-structure.html#array[array] - * Default value is `[]` - -If this filter is successful, remove arbitrary fields from this event. -Fields names can be dynamic and include parts of the event using the %{field} -Example: - -["source","json",subs="attributes"] - filter { - {plugin} { - remove_field => [ "foo_%\{somefield\}" ] - } - } - -["source","json",subs="attributes"] - # You can also remove multiple fields at once: - filter { - {plugin} { - remove_field => [ "foo_%\{somefield\}", "my_extraneous_field" ] - } - } - -If the event has field `"somefield" == "hello"` this filter, on success, -would remove the field with name `foo_hello` if it is present. The second -example would remove an additional, non-dynamic field. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-remove_tag"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-remove_tag"] -endif::[] -===== `remove_tag` - - * Value type is {logstash-ref}/configuration-file-structure.html#array[array] - * Default value is `[]` - -If this filter is successful, remove arbitrary tags from the event. -Tags can be dynamic and include parts of the event using the `%{field}` -syntax. - -Example: - -["source","json",subs="attributes"] - filter { - {plugin} { - remove_tag => [ "foo_%\{somefield\}" ] - } - } - -["source","json",subs="attributes"] - # You can also remove multiple tags at once: - filter { - {plugin} { - remove_tag => [ "foo_%\{somefield\}", "sad_unwanted_tag"] - } - } - -If the event has field `"somefield" == "hello"` this filter, on success, -would remove the tag `foo_hello` if it is present. The second example -would remove a sad, unwanted tag as well. diff --git a/docs/include/input.asciidoc b/docs/include/input.asciidoc deleted file mode 100644 index d0b9b5cd0..000000000 --- a/docs/include/input.asciidoc +++ /dev/null @@ -1,175 +0,0 @@ -==== Common Options - -// Contributors: You must conditionally code all internal links and IDs in this -// file to make the common files work in both the LS Reference and the versioned -// plugin docs - -The following configuration options are supported by all input plugins: - -[cols="<,<,<",options="header",] -ifeval::["{versioned_docs}"!="true"] -|======================================================================= -|Setting |Input type|Required -| <> |{logstash-ref}/configuration-file-structure.html#hash[hash]|No -ifndef::no_codec[] -| <> |{logstash-ref}/configuration-file-structure.html#codec[codec]|No -endif::no_codec[] -| <> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <> |{logstash-ref}/configuration-file-structure.html#string[string]|No -| <> |{logstash-ref}/configuration-file-structure.html#array[array]|No -| <> |{logstash-ref}/configuration-file-structure.html#string[string]|No -|======================================================================= -endif::[] -ifeval::["{versioned_docs}"=="true"] -|======================================================================= -|Setting |Input type|Required -| <<{version}-plugins-{type}s-{plugin}-add_field>> |{logstash-ref}/configuration-file-structure.html#hash[hash]|No -ifndef::no_codec[] -| <<{version}-plugins-{type}s-{plugin}-codec>> |{logstash-ref}/configuration-file-structure.html#codec[codec]|No -endif::no_codec[] -| <<{version}-plugins-{type}s-{plugin}-enable_metric>> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <<{version}-plugins-{type}s-{plugin}-id>> |{logstash-ref}/configuration-file-structure.html#string[string]|No -| <<{version}-plugins-{type}s-{plugin}-tags>> |{logstash-ref}/configuration-file-structure.html#array[array]|No -| <<{version}-plugins-{type}s-{plugin}-type>> |{logstash-ref}/configuration-file-structure.html#string[string]|No -|======================================================================= -endif::[] - -==== Details - -  - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-add_field"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-add_field"] -endif::[] -===== `add_field` - - * Value type is {logstash-ref}/configuration-file-structure.html#hash[hash] - * Default value is `{}` - -Add a field to an event - -ifndef::no_codec[] -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-codec"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-codec"] -endif::[] -===== `codec` - - * Value type is {logstash-ref}/configuration-file-structure.html#codec[codec] -ifdef::default_codec[] - * Default value is +"{default_codec}"+ -endif::[] -ifndef::default_codec[] - * Default value is `"plain"` -endif::[] - -The codec used for input data. Input codecs are a convenient method for decoding your data before it enters the input, without needing a separate filter in your Logstash pipeline. -endif::no_codec[] - - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-enable_metric"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-enable_metric"] -endif::[] -===== `enable_metric` - - * Value type is {logstash-ref}/configuration-file-structure.html#boolean[boolean] - * Default value is `true` - -Disable or enable metric logging for this specific plugin instance -by default we record all the metrics we can, but you can disable metrics collection -for a specific plugin. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-id"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-id"] -endif::[] -===== `id` - - * Value type is {logstash-ref}/configuration-file-structure.html#string[string] - * There is no default value for this setting. - -Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one. -It is strongly recommended to set this ID in your configuration. This is particularly useful -when you have two or more plugins of the same type, for example, if you have 2 {plugin} inputs. -Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs. - -["source","json",subs="attributes"] ---------------------------------------------------------------------------------------------------- -input { - {plugin} { - id => "my_plugin_id" - } -} ---------------------------------------------------------------------------------------------------- - -NOTE: Variable substitution in the `id` field only supports environment variables - and does not support the use of values from the secret store. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-tags"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-tags"] -endif::[] -===== `tags` - - * Value type is {logstash-ref}/configuration-file-structure.html#array[array] - * There is no default value for this setting. - -Add any number of arbitrary tags to your event. - -This can help with processing later. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-type"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-type"] -endif::[] -===== `type` - - * Value type is {logstash-ref}/configuration-file-structure.html#string[string] - * There is no default value for this setting. - -Add a `type` field to all events handled by this input. - -Types are used mainly for filter activation. - -The type is stored as part of the event itself, so you can -also use the type to search for it in Kibana. - -If you try to set a type on an event that already has one (for -example when you send an event from a shipper to an indexer) then -a new input will not override the existing type. A type set at -the shipper stays with that event for its life even -when sent to another Logstash server. - -ifeval::["{type}"=="input"] -ifeval::["{plugin}"=="beats"] - -ifeval::["{versioned_docs}"!="true"] -NOTE: The Beats shipper automatically sets the `type` field on the event. -You cannot override this setting in the Logstash config. If you specify -a setting for the <> config option in -Logstash, it is ignored. -endif::[] -ifeval::["{versioned_docs}"=="true"] -NOTE: The Beats shipper automatically sets the `type` field on the event. -You cannot override this setting in the Logstash config. If you specify -a setting for the <<{version}-plugins-inputs-beats-type,`type`>> config option in -Logstash, it is ignored. -endif::[] - -endif::[] -endif::[] - diff --git a/docs/include/output.asciidoc b/docs/include/output.asciidoc deleted file mode 100644 index 5d8090645..000000000 --- a/docs/include/output.asciidoc +++ /dev/null @@ -1,94 +0,0 @@ -==== Common Options - -// Contributors: You must conditionally code all internal links and IDs in this -// file to make the common files work in both the LS Reference and the versioned -// plugin docs - -The following configuration options are supported by all output plugins: - -ifeval::["{versioned_docs}"!="true"] -[cols="<,<,<",options="header",] -|======================================================================= -|Setting |Input type|Required -ifndef::no_codec[] -| <> |{logstash-ref}/configuration-file-structure.html#codec[codec]|No -endif::no_codec[] -| <> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <> |{logstash-ref}/configuration-file-structure.html#string[string]|No -|======================================================================= -endif::[] -ifeval::["{versioned_docs}"=="true"] -[cols="<,<,<",options="header",] -|======================================================================= -|Setting |Input type|Required -ifndef::no_codec[] -| <<{version}-plugins-{type}s-{plugin}-codec>> |{logstash-ref}/configuration-file-structure.html#codec[codec]|No -endif::no_codec[] -| <<{version}-plugins-{type}s-{plugin}-enable_metric>> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No -| <<{version}-plugins-{type}s-{plugin}-id>> |{logstash-ref}/configuration-file-structure.html#string[string]|No -|======================================================================= -endif::[] - -ifndef::no_codec[] -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-codec"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-codec"] -endif::[] -===== `codec` - - * Value type is {logstash-ref}/configuration-file-structure.html#codec[codec] -ifdef::default_codec[] - * Default value is +"{default_codec}"+ -endif::[] -ifndef::default_codec[] - * Default value is `"plain"` -endif::[] - -The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output without needing a separate filter in your Logstash pipeline. -endif::no_codec[] - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-enable_metric"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-enable_metric"] -endif::[] -===== `enable_metric` - - * Value type is {logstash-ref}/configuration-file-structure.html#boolean[boolean] - * Default value is `true` - -Disable or enable metric logging for this specific plugin instance. -By default we record all the metrics we can, but you can disable metrics collection -for a specific plugin. - -ifeval::["{versioned_docs}"!="true"] -[id="plugins-{type}s-{plugin}-id"] -endif::[] -ifeval::["{versioned_docs}"=="true"] -[id="{version}-plugins-{type}s-{plugin}-id"] -endif::[] -===== `id` - - * Value type is {logstash-ref}/configuration-file-structure.html#string[string] - * There is no default value for this setting. - -Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one. -It is strongly recommended to set this ID in your configuration. This is particularly useful -when you have two or more plugins of the same type. For example, if you have 2 {plugin} outputs. -Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs. - -["source","json",subs="attributes"] ---------------------------------------------------------------------------------------------------- -output { - {plugin} { - id => "my_plugin_id" - } -} ---------------------------------------------------------------------------------------------------- - -NOTE: Variable substitution in the `id` field only supports environment variables - and does not support the use of values from the secret store. - diff --git a/docs/include/plugin_header-core.asciidoc b/docs/include/plugin_header-core.asciidoc deleted file mode 100644 index 64717a25d..000000000 --- a/docs/include/plugin_header-core.asciidoc +++ /dev/null @@ -1,14 +0,0 @@ -[subs="attributes"] -++++ -{plugin} -++++ - -*{ls} Core Plugin.* The {plugin} {type} plugin cannot be -installed or uninstalled independently of {ls}. - -==== Getting Help - -For questions about the plugin, open a topic in the -http://discuss.elastic.co[Discuss] forums. For bugs or feature requests, open an -issue in https://github.com/logstash[Github]. - diff --git a/docs/include/plugin_header-integration.asciidoc b/docs/include/plugin_header-integration.asciidoc deleted file mode 100644 index 6cba76a46..000000000 --- a/docs/include/plugin_header-integration.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -[subs="attributes"] -++++ -{plugin} -++++ - -* A component of the <> -* Integration version: {version} -* Released on: {release_date} -* {changelog_url}[Changelog] - -For other versions, see the -{lsplugindocs}/{type}-{plugin}-index.html[Versioned plugin docs]. - -==== Getting Help - -For questions about the plugin, open a topic in the http://discuss.elastic.co[Discuss] forums. -For bugs or feature requests, open an issue in https://github.com/logstash-plugins/logstash-integration-{integration}[Github]. -For the list of Elastic supported plugins, please consult the https://www.elastic.co/support/matrix#logstash_plugins[Elastic Support Matrix]. - diff --git a/docs/include/plugin_header.asciidoc b/docs/include/plugin_header.asciidoc deleted file mode 100644 index 2e5e714e8..000000000 --- a/docs/include/plugin_header.asciidoc +++ /dev/null @@ -1,25 +0,0 @@ -[subs="attributes"] -++++ -{plugin} -++++ - -* Plugin version: {version} -* Released on: {release_date} -* {changelog_url}[Changelog] - -For other versions, see the -{lsplugindocs}/{type}-{plugin}-index.html[Versioned plugin docs]. - -ifeval::["{default_plugin}"=="0"] - -==== Installation - -For plugins not bundled by default, it is easy to install by running +bin/logstash-plugin install logstash-{type}-{plugin}+. See {logstash-ref}/working-with-plugins.html[Working with plugins] for more details. - -endif::[] - -==== Getting Help - -For questions about the plugin, open a topic in the http://discuss.elastic.co[Discuss] forums. For bugs or feature requests, open an issue in https://github.com/logstash-plugins/logstash-{type}-{plugin}[Github]. -For the list of Elastic supported plugins, please consult the https://www.elastic.co/support/matrix#logstash_plugins[Elastic Support Matrix]. - diff --git a/docs/include/version-list-intro.asciidoc b/docs/include/version-list-intro.asciidoc deleted file mode 100644 index c396d201c..000000000 --- a/docs/include/version-list-intro.asciidoc +++ /dev/null @@ -1,14 +0,0 @@ -[id="{type}-{plugin}-index"] - -== Versioned {plugin} {type} plugin docs -[subs="attributes"] -++++ -{plugin} -++++ - -This page lists all available versions of the documentation for this plugin. -To see which version of the plugin you have installed, run `bin/logstash-plugin -list --verbose`. - -NOTE: Versioned plugin documentation is not available for plugins released prior -to Logstash 6.0. diff --git a/docs/index.asciidoc b/docs/index.asciidoc deleted file mode 100644 index 34dad2ee3..000000000 --- a/docs/index.asciidoc +++ /dev/null @@ -1,248 +0,0 @@ -[[logstash-reference]] -= Logstash Reference - -include::{docs-root}/shared/versions/stack/{source_branch}.asciidoc[] -include::{docs-root}/shared/attributes.asciidoc[] -include::./include/attributes-ls.asciidoc[] -include::./include/attributes-lsplugins.asciidoc[] - -:include-xpack: true -:lang: en -:xls-repo-dir: {docdir}/../x-pack/docs/{lang} -:log-repo-dir: {docdir} -:plugins-repo-dir: {docdir}/../../logstash-docs/docs -:docker-repo: docker.elastic.co/logstash/logstash -:docker-image: {docker-repo}:{logstash_version} - -:versioned_docs: false - -:jdk: 1.8.0 -:lsissue: https://github.com/elastic/logstash/issues -:lsplugindocs: https://www.elastic.co/guide/en/logstash-versioned-plugins/current -:tab-widget-dir: {docdir}/static/tab-widgets - - -[[introduction]] -== Logstash Introduction - -Logstash is an open source data collection engine with real-time pipelining capabilities. Logstash can dynamically -unify data from disparate sources and normalize the data into destinations of your choice. Cleanse and democratize all -your data for diverse advanced downstream analytics and visualization use cases. - -While Logstash originally drove innovation in log collection, its capabilities extend well beyond that use case. Any -type of event can be enriched and transformed with a broad array of input, filter, and output plugins, with many -native codecs further simplifying the ingestion process. Logstash accelerates your insights by harnessing a greater -volume and variety of data. - - -[serverless] -.Logstash to {serverless-full} -**** -You'll use the {ls} <> to send data to {serverless-full}. -Note these differences between {es-serverless} and both {ess} and self-managed {es}: - -* Use *API keys* to access {serverless-full} from {ls}. -Any user-based security settings in your in your <> configuration are ignored and may cause errors. -* {serverless-full} uses *data streams* and {ref}/data-stream-lifecycle.html[{dlm} ({dlm-init})] instead of {ilm} ({ilm-init}). -Any {ilm-init} settings in your <> configuration are ignored and may cause errors. -* *{ls} monitoring* is available through the https://github.com/elastic/integrations/blob/main/packages/logstash/_dev/build/docs/README.md[{ls} Integration] in {serverless-docs}/observability/what-is-observability-serverless[Elastic Observability] on {serverless-full}. - - -.Known issue for {ls} to {es-serverless}. - -The logstash-output-elasticsearch `hosts` setting defaults to port :9200. Set the value to port :443 instead. -**** - - -// The pass blocks here point to the correct repository for the edit links in the guide. - -// Introduction - -// Getting Started with Logstash -include::static/getting-started-with-logstash.asciidoc[] - -// Advanced LS Pipelines -include::static/advanced-pipeline.asciidoc[] - -// Processing Pipeline -include::static/life-of-an-event.asciidoc[] - -// Elastic Common Schema (ECS) -include::static/ecs-compatibility.asciidoc[] - -// Processing details -include::static/processing-info.asciidoc[] - -// Logstash setup -include::static/setting-up-logstash.asciidoc[] - -include::static/settings-file.asciidoc[] - -include::static/keystore.asciidoc[] - -include::static/running-logstash-command-line.asciidoc[] - -include::static/running-logstash.asciidoc[] - -include::static/docker.asciidoc[] - -include::static/running-logstash-kubernetes.asciidoc[] - -include::static/running-logstash-windows.asciidoc[] - -include::static/logging.asciidoc[] - -include::static/shutdown.asciidoc[] - -// Upgrading Logstash -include::static/upgrading.asciidoc[] - -// Configuring pipelines -include::static/pipeline-configuration.asciidoc[] - -// Security -include::static/security/logstash.asciidoc[] - -// Advanced Logstash Configuration -include::static/configuration-advanced.asciidoc[] - -include::static/multiple-pipelines.asciidoc[] - -include::static/pipeline-pipeline-config.asciidoc[] - -include::static/reloading-config.asciidoc[] - -include::static/managing-multiline-events.asciidoc[] - -include::static/glob-support.asciidoc[] - -include::static/ingest-convert.asciidoc[] - -include::static/field-reference.asciidoc[] - -//The `field-reference.asciidoc` file (included above) contains a -//`role="exclude"` attribute to pull in the topic and make it linkable in the LS -//Ref, but not appear in the main TOC. The `exclude`attribute was carrying -//forward for all subsequent topics under the `configuration.asciidoc` heading. -//This include should remain after includes for all other topics under the -//`Advanced Logstash Configuration` heading. - -// Logstash-to-Logstash -include::static/ls-ls-config.asciidoc[] - -// Centralized configuration managements -include::static/config-management.asciidoc[] - -include::static/management/configuring-centralized-pipelines.asciidoc[] - -// EA Integrations to Logstash -// (Planting near module content for now. Will likely move it up in info architecture.) -include::static/ea-integrations.asciidoc[] - -// Working with Logstash Modules -include::static/modules.asciidoc[] - -include::static/arcsight-module.asciidoc[] - -include::static/netflow-module.asciidoc[] - -include::static/azure-module.asciidoc[] - -// Working with Filebeat Modules -include::static/filebeat-modules.asciidoc[] - -// Working with Winlogbeat Modules -include::static/winlogbeat-modules.asciidoc[] - -// Data resiliency -include::static/resiliency.asciidoc[] - -include::static/mem-queue.asciidoc[] - -include::static/persistent-queues.asciidoc[] - -include::static/dead-letter-queues.asciidoc[] - -// Transforming Data -include::static/transforming-data.asciidoc[] - -// Deploying & Scaling -include::static/deploying.asciidoc[] - -// GeoIP Database Management -include::static/geoip-database-management.asciidoc[] - -// Troubleshooting performance -include::static/performance-checklist.asciidoc[] - -// Monitoring -include::static/monitoring/monitoring-ea-intro.asciidoc[] - -include::static/monitoring/monitoring-overview.asciidoc[] - -include::static/monitoring/monitoring.asciidoc[] - -// Working with Plugins -include::static/plugin-manager.asciidoc[] - -// These files do their own pass blocks - -include::{plugins-repo-dir}/plugins/integrations.asciidoc[] - -include::{plugins-repo-dir}/plugins/inputs.asciidoc[] - -include::{plugins-repo-dir}/plugins/outputs.asciidoc[] - -include::{plugins-repo-dir}/plugins/filters.asciidoc[] - -include::{plugins-repo-dir}/plugins/codecs.asciidoc[] - -// FAQ and Troubleshooting -:edit_url!: -include::static/best-practice.asciidoc[] - -include::static/config-details.asciidoc[] - -include::static/troubleshoot/troubleshooting.asciidoc[] - -// Contributing to Logstash -:edit_url: -include::static/contributing-to-logstash.asciidoc[] - -include::static/input.asciidoc[] - -include::static/codec.asciidoc[] - -include::static/filter.asciidoc[] - -include::static/output.asciidoc[] - -// Logstash Community Maintainer Guide -include::static/maintainer-guide.asciidoc[] - -// Plugin doc guidelines -include::static/doc-for-plugin.asciidoc[] - -// Submitting a Plugin -include::static/submitting-a-plugin.asciidoc[] - -include::static/listing-a-plugin.asciidoc[] - -include::static/contributing-patch.asciidoc[] - -include::static/contribute-core.asciidoc[] - -// Contributing to Logstash - JAVA EDITION -:edit_url: -include::static/contributing-java-plugin.asciidoc[] - -// Breaking Changes -include::static/breaking-changes.asciidoc[] - -// Release Notes -include::static/releasenotes.asciidoc[] - -:edit_url: -include::static/redirects.asciidoc[] - -:edit_url!: diff --git a/docs/index.x.asciidoc b/docs/index.x.asciidoc deleted file mode 100644 index 35204eef5..000000000 --- a/docs/index.x.asciidoc +++ /dev/null @@ -1 +0,0 @@ -include::index.asciidoc[] diff --git a/docs/reference/advanced-logstash-configurations.md b/docs/reference/advanced-logstash-configurations.md new file mode 100644 index 000000000..13e46133c --- /dev/null +++ b/docs/reference/advanced-logstash-configurations.md @@ -0,0 +1,14 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/configuration-advanced.html +--- + +# Advanced Logstash configurations [configuration-advanced] + +You can take {{ls}} beyond basic configuration to handle more advanced requirements, such as multiple pipelines, communication between {{ls}} pipelines, and multiple line events. + + + + + + diff --git a/docs/reference/advanced-pipeline.md b/docs/reference/advanced-pipeline.md new file mode 100644 index 000000000..ab0529765 --- /dev/null +++ b/docs/reference/advanced-pipeline.md @@ -0,0 +1,610 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/advanced-pipeline.html +--- + +# Parsing Logs with Logstash [advanced-pipeline] + +In [Stashing Your First Event](/reference/first-event.md), you created a basic Logstash pipeline to test your Logstash setup. In the real world, a Logstash pipeline is a bit more complex: it typically has one or more input, filter, and output plugins. + +In this section, you create a Logstash pipeline that uses Filebeat to take Apache web logs as input, parses those logs to create specific, named fields from the logs, and writes the parsed data to an Elasticsearch cluster. Rather than defining the pipeline configuration at the command line, you’ll define the pipeline in a config file. + +To get started, go [here](https://download.elastic.co/demos/logstash/gettingstarted/logstash-tutorial.log.gz) to download the sample data set used in this example. Unpack the file. + +## Configuring Filebeat to Send Log Lines to Logstash [configuring-filebeat] + +Before you create the Logstash pipeline, you’ll configure Filebeat to send log lines to Logstash. The [Filebeat](https://github.com/elastic/beats/tree/main/filebeat) client is a lightweight, resource-friendly tool that collects logs from files on the server and forwards these logs to your Logstash instance for processing. Filebeat is designed for reliability and low latency. Filebeat has a light resource footprint on the host machine, and the [`Beats input`](logstash-docs-md://lsr/plugins-inputs-beats.md) plugin minimizes the resource demands on the Logstash instance. + +::::{note} +In a typical use case, Filebeat runs on a separate machine from the machine running your Logstash instance. For the purposes of this tutorial, Logstash and Filebeat are running on the same machine. +:::: + + +The default Logstash installation includes the [`Beats input`](logstash-docs-md://lsr/plugins-inputs-beats.md) plugin. The Beats input plugin enables Logstash to receive events from the Elastic Beats framework, which means that any Beat written to work with the Beats framework, such as Packetbeat and Metricbeat, can also send event data to Logstash. + +To install Filebeat on your data source machine, download the appropriate package from the Filebeat [product page](https://www.elastic.co/downloads/beats/filebeat). You can also refer to [Filebeat quick start](beats://reference/filebeat/filebeat-installation-configuration.md) for additional installation instructions. + +After installing Filebeat, you need to configure it. Open the `filebeat.yml` file located in your Filebeat installation directory, and replace the contents with the following lines. Make sure `paths` points to the example Apache log file, `logstash-tutorial.log`, that you downloaded earlier: + +```yaml +filebeat.inputs: +- type: log + paths: + - /path/to/file/logstash-tutorial.log <1> +output.logstash: + hosts: ["localhost:5044"] +``` + +1. Absolute path to the file or files that Filebeat processes. + + +Save your changes. + +To keep the configuration simple, you won’t specify TLS/SSL settings as you would in a real world scenario. + +At the data source machine, run Filebeat with the following command: + +```shell +sudo ./filebeat -e -c filebeat.yml -d "publish" +``` + +::::{note} +If you run Filebeat as root, you need to change ownership of the configuration file (see [Config File Ownership and Permissions](beats://reference/libbeat/config-file-permissions.md) in the *Beats Platform Reference*). +:::: + + +Filebeat will attempt to connect on port 5044. Until Logstash starts with an active Beats plugin, there won’t be any answer on that port, so any messages you see regarding failure to connect on that port are normal for now. + + +## Configuring Logstash for Filebeat Input [_configuring_logstash_for_filebeat_input] + +Next, you create a Logstash configuration pipeline that uses the Beats input plugin to receive events from Beats. + +The following text represents the skeleton of a configuration pipeline: + +```json +# The # character at the beginning of a line indicates a comment. Use +# comments to describe your configuration. +input { +} +# The filter part of this file is commented out to indicate that it is +# optional. +# filter { +# +# } +output { +} +``` + +This skeleton is non-functional, because the input and output sections don’t have any valid options defined. + +To get started, copy and paste the skeleton configuration pipeline into a file named `first-pipeline.conf` in your home Logstash directory. + +Next, configure your Logstash instance to use the Beats input plugin by adding the following lines to the `input` section of the `first-pipeline.conf` file: + +```json + beats { + port => "5044" + } +``` + +You’ll configure Logstash to write to Elasticsearch later. For now, you can add the following line to the `output` section so that the output is printed to stdout when you run Logstash: + +```json + stdout { codec => rubydebug } +``` + +When you’re done, the contents of `first-pipeline.conf` should look like this: + +```json +input { + beats { + port => "5044" + } +} +# The filter part of this file is commented out to indicate that it is +# optional. +# filter { +# +# } +output { + stdout { codec => rubydebug } +} +``` + +To verify your configuration, run the following command: + +```shell +bin/logstash -f first-pipeline.conf --config.test_and_exit +``` + +The `--config.test_and_exit` option parses your configuration file and reports any errors. + +If the configuration file passes the configuration test, start Logstash with the following command: + +```shell +bin/logstash -f first-pipeline.conf --config.reload.automatic +``` + +The `--config.reload.automatic` option enables automatic config reloading so that you don’t have to stop and restart Logstash every time you modify the configuration file. + +As Logstash starts up, you might see one or more warning messages about Logstash ignoring the `pipelines.yml` file. You can safely ignore this warning. The `pipelines.yml` file is used for running [multiple pipelines](/reference/multiple-pipelines.md) in a single Logstash instance. For the examples shown here, you are running a single pipeline. + +If your pipeline is working correctly, you should see a series of events like the following written to the console: + +```json +{ + "@timestamp" => 2017-11-09T01:44:20.071Z, + "offset" => 325, + "@version" => "1", + "beat" => { + "name" => "My-MacBook-Pro.local", + "hostname" => "My-MacBook-Pro.local", + "version" => "6.0.0" + }, + "host" => "My-MacBook-Pro.local", + "prospector" => { + "type" => "log" + }, + "input" => { + "type" => "log" + }, + "source" => "/path/to/file/logstash-tutorial.log", + "message" => "83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] \"GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1\" 200 203023 \"http://semicomplete.com/presentations/logstash-monitorama-2013/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\"", + "tags" => [ + [0] "beats_input_codec_plain_applied" + ] +} +... +``` + + +### Parsing Web Logs with the Grok Filter Plugin [configuring-grok-filter] + +Now you have a working pipeline that reads log lines from Filebeat. However you’ll notice that the format of the log messages is not ideal. You want to parse the log messages to create specific, named fields from the logs. To do this, you’ll use the `grok` filter plugin. + +The [`grok`](logstash-docs-md://lsr/plugins-filters-grok.md) filter plugin is one of several plugins that are available by default in Logstash. For details on how to manage Logstash plugins, see the [reference documentation](/reference/working-with-plugins.md) for the plugin manager. + +The `grok` filter plugin enables you to parse the unstructured log data into something structured and queryable. + +Because the `grok` filter plugin looks for patterns in the incoming log data, configuring the plugin requires you to make decisions about how to identify the patterns that are of interest to your use case. A representative line from the web server log sample looks like this: + +```shell +83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png +HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel +Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36" +``` + +The IP address at the beginning of the line is easy to identify, as is the timestamp in brackets. To parse the data, you can use the `%{{COMBINEDAPACHELOG}}` grok pattern, which structures lines from the Apache log using the following schema: + +**Information** +: **Field Name** + +IP Address +: `clientip` + +User ID +: `ident` + +User Authentication +: `auth` + +timestamp +: `timestamp` + +HTTP Verb +: `verb` + +Request body +: `request` + +HTTP Version +: `httpversion` + +HTTP Status Code +: `response` + +Bytes served +: `bytes` + +Referrer URL +: `referrer` + +User agent +: `agent` + +::::{tip} +If you need help building grok patterns, try out the [Grok Debugger](docs-content://explore-analyze/query-filter/tools/grok-debugger.md). The Grok Debugger is an {{xpack}} feature under the Basic License and is therefore **free to use**. +:::: + + +Edit the `first-pipeline.conf` file and replace the entire `filter` section with the following text: + +```json +filter { + grok { + match => { "message" => "%{COMBINEDAPACHELOG}"} + } +} +``` + +When you’re done, the contents of `first-pipeline.conf` should look like this: + +```json +input { + beats { + port => "5044" + } +} +filter { + grok { + match => { "message" => "%{COMBINEDAPACHELOG}"} + } +} +output { + stdout { codec => rubydebug } +} +``` + +Save your changes. Because you’ve enabled automatic config reloading, you don’t have to restart Logstash to pick up your changes. However, you do need to force Filebeat to read the log file from scratch. To do this, go to the terminal window where Filebeat is running and press Ctrl+C to shut down Filebeat. Then delete the Filebeat registry file. For example, run: + +```shell +sudo rm data/registry +``` + +Since Filebeat stores the state of each file it harvests in the registry, deleting the registry file forces Filebeat to read all the files it’s harvesting from scratch. + +Next, restart Filebeat with the following command: + +```shell +sudo ./filebeat -e -c filebeat.yml -d "publish" +``` + +There might be a slight delay before Filebeat begins processing events if it needs to wait for Logstash to reload the config file. + +After Logstash applies the grok pattern, the events will have the following JSON representation: + +```json +{ + "request" => "/presentations/logstash-monitorama-2013/images/kibana-search.png", + "agent" => "\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\"", + "offset" => 325, + "auth" => "-", + "ident" => "-", + "verb" => "GET", + "prospector" => { + "type" => "log" + }, + "input" => { + "type" => "log" + }, + "source" => "/path/to/file/logstash-tutorial.log", + "message" => "83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] \"GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1\" 200 203023 \"http://semicomplete.com/presentations/logstash-monitorama-2013/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\"", + "tags" => [ + [0] "beats_input_codec_plain_applied" + ], + "referrer" => "\"http://semicomplete.com/presentations/logstash-monitorama-2013/\"", + "@timestamp" => 2017-11-09T02:51:12.416Z, + "response" => "200", + "bytes" => "203023", + "clientip" => "83.149.9.216", + "@version" => "1", + "beat" => { + "name" => "My-MacBook-Pro.local", + "hostname" => "My-MacBook-Pro.local", + "version" => "6.0.0" + }, + "host" => "My-MacBook-Pro.local", + "httpversion" => "1.1", + "timestamp" => "04/Jan/2015:05:13:42 +0000" +} +``` + +Notice that the event includes the original message, but the log message is also broken down into specific fields. + + +### Enhancing Your Data with the Geoip Filter Plugin [configuring-geoip-plugin] + +In addition to parsing log data for better searches, filter plugins can derive supplementary information from existing data. As an example, the [`geoip`](logstash-docs-md://lsr/plugins-filters-geoip.md) plugin looks up IP addresses, derives geographic location information from the addresses, and adds that location information to the logs. + +Configure your Logstash instance to use the `geoip` filter plugin by adding the following lines to the `filter` section of the `first-pipeline.conf` file: + +```json + geoip { + source => "clientip" + } +``` + +The `geoip` plugin configuration requires you to specify the name of the source field that contains the IP address to look up. In this example, the `clientip` field contains the IP address. + +Since filters are evaluated in sequence, make sure that the `geoip` section is after the `grok` section of the configuration file and that both the `grok` and `geoip` sections are nested within the `filter` section. + +When you’re done, the contents of `first-pipeline.conf` should look like this: + +```json +input { + beats { + port => "5044" + } +} + filter { + grok { + match => { "message" => "%{COMBINEDAPACHELOG}"} + } + geoip { + source => "clientip" + } +} +output { + stdout { codec => rubydebug } +} +``` + +Save your changes. To force Filebeat to read the log file from scratch, as you did earlier, shut down Filebeat (press Ctrl+C), delete the registry file, and then restart Filebeat with the following command: + +```shell +sudo ./filebeat -e -c filebeat.yml -d "publish" +``` + +Notice that the event now contains geographic location information: + +```json +{ + "request" => "/presentations/logstash-monitorama-2013/images/kibana-search.png", + "agent" => "\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\"", + "geoip" => { + "timezone" => "Europe/Moscow", + "ip" => "83.149.9.216", + "latitude" => 55.7485, + "continent_code" => "EU", + "city_name" => "Moscow", + "country_name" => "Russia", + "country_code2" => "RU", + "country_code3" => "RU", + "region_name" => "Moscow", + "location" => { + "lon" => 37.6184, + "lat" => 55.7485 + }, + "postal_code" => "101194", + "region_code" => "MOW", + "longitude" => 37.6184 + }, + ... +``` + + +### Indexing Your Data into Elasticsearch [indexing-parsed-data-into-elasticsearch] + +Now that the web logs are broken down into specific fields, you’re ready to get your data into Elasticsearch. + +::::{tip} +{ess-leadin} +:::: + + +The Logstash pipeline can index the data into an Elasticsearch cluster. Edit the `first-pipeline.conf` file and replace the entire `output` section with the following text: + +```json +output { + elasticsearch { + hosts => [ "localhost:9200" ] + } +} +``` + +With this configuration, Logstash uses http protocol to connect to Elasticsearch. The above example assumes that Logstash and Elasticsearch are running on the same instance. You can specify a remote Elasticsearch instance by using the `hosts` configuration to specify something like `hosts => [ "es-machine:9092" ]`. + +At this point, your `first-pipeline.conf` file has input, filter, and output sections properly configured, and looks something like this: + +```json +input { + beats { + port => "5044" + } +} + filter { + grok { + match => { "message" => "%{COMBINEDAPACHELOG}"} + } + geoip { + source => "clientip" + } +} +output { + elasticsearch { + hosts => [ "localhost:9200" ] + } +} +``` + +Save your changes. To force Filebeat to read the log file from scratch, as you did earlier, shut down Filebeat (press Ctrl+C), delete the registry file, and then restart Filebeat with the following command: + +```shell +sudo ./filebeat -e -c filebeat.yml -d "publish" +``` + + +#### Testing Your Pipeline [testing-initial-pipeline] + +Now that the Logstash pipeline is configured to index the data into an Elasticsearch cluster, you can query Elasticsearch. + +Try a test query to Elasticsearch based on the fields created by the `grok` filter plugin. Replace $DATE with the current date, in YYYY.MM.DD format: + +```shell +curl -XGET 'localhost:9200/logstash-$DATE/_search?pretty&q=response=200' +``` + +::::{note} +The date used in the index name is based on UTC, not the timezone where Logstash is running. If the query returns `index_not_found_exception`, make sure that `logstash-$DATE` reflects the actual name of the index. To see a list of available indexes, use this query: `curl 'localhost:9200/_cat/indices?v'`. +:::: + + +You should get multiple hits back. For example: + +```json +{ + "took": 50, + "timed_out": false, + "_shards": { + "total": 5, + "successful": 5, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": 98, + "max_score": 2.793642, + "hits": [ + { + "_index": "logstash-2017.11.09", + "_type": "doc", + "_id": "3IzDnl8BW52sR0fx5wdV", + "_score": 2.793642, + "_source": { + "request": "/presentations/logstash-monitorama-2013/images/frontend-response-codes.png", + "agent": """"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"""", + "geoip": { + "timezone": "Europe/Moscow", + "ip": "83.149.9.216", + "latitude": 55.7485, + "continent_code": "EU", + "city_name": "Moscow", + "country_name": "Russia", + "country_code2": "RU", + "country_code3": "RU", + "region_name": "Moscow", + "location": { + "lon": 37.6184, + "lat": 55.7485 + }, + "postal_code": "101194", + "region_code": "MOW", + "longitude": 37.6184 + }, + "offset": 2932, + "auth": "-", + "ident": "-", + "verb": "GET", + "prospector": { + "type": "log" + }, + "input": { + "type": "log" + }, + "source": "/path/to/file/logstash-tutorial.log", + "message": """83.149.9.216 - - [04/Jan/2015:05:13:45 +0000] "GET /presentations/logstash-monitorama-2013/images/frontend-response-codes.png HTTP/1.1" 200 52878 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"""", + "tags": [ + "beats_input_codec_plain_applied" + ], + "referrer": """"http://semicomplete.com/presentations/logstash-monitorama-2013/"""", + "@timestamp": "2017-11-09T03:11:35.304Z", + "response": "200", + "bytes": "52878", + "clientip": "83.149.9.216", + "@version": "1", + "beat": { + "name": "My-MacBook-Pro.local", + "hostname": "My-MacBook-Pro.local", + "version": "6.0.0" + }, + "host": "My-MacBook-Pro.local", + "httpversion": "1.1", + "timestamp": "04/Jan/2015:05:13:45 +0000" + } + }, + ... +``` + +Try another search for the geographic information derived from the IP address. Replace $DATE with the current date, in YYYY.MM.DD format: + +```shell +curl -XGET 'localhost:9200/logstash-$DATE/_search?pretty&q=geoip.city_name=Buffalo' +``` + +A few log entries come from Buffalo, so the query produces the following response: + +```json +{ + "took": 9, + "timed_out": false, + "_shards": { + "total": 5, + "successful": 5, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": 2, + "max_score": 2.6390574, + "hits": [ + { + "_index": "logstash-2017.11.09", + "_type": "doc", + "_id": "L4zDnl8BW52sR0fx5whY", + "_score": 2.6390574, + "_source": { + "request": "/blog/geekery/disabling-battery-in-ubuntu-vms.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+semicomplete%2Fmain+%28semicomplete.com+-+Jordan+Sissel%29", + "agent": """"Tiny Tiny RSS/1.11 (http://tt-rss.org/)"""", + "geoip": { + "timezone": "America/New_York", + "ip": "198.46.149.143", + "latitude": 42.8864, + "continent_code": "NA", + "city_name": "Buffalo", + "country_name": "United States", + "country_code2": "US", + "dma_code": 514, + "country_code3": "US", + "region_name": "New York", + "location": { + "lon": -78.8781, + "lat": 42.8864 + }, + "postal_code": "14202", + "region_code": "NY", + "longitude": -78.8781 + }, + "offset": 22795, + "auth": "-", + "ident": "-", + "verb": "GET", + "prospector": { + "type": "log" + }, + "input": { + "type": "log" + }, + "source": "/path/to/file/logstash-tutorial.log", + "message": """198.46.149.143 - - [04/Jan/2015:05:29:13 +0000] "GET /blog/geekery/disabling-battery-in-ubuntu-vms.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+semicomplete%2Fmain+%28semicomplete.com+-+Jordan+Sissel%29 HTTP/1.1" 200 9316 "-" "Tiny Tiny RSS/1.11 (http://tt-rss.org/)"""", + "tags": [ + "beats_input_codec_plain_applied" + ], + "referrer": """"-"""", + "@timestamp": "2017-11-09T03:11:35.321Z", + "response": "200", + "bytes": "9316", + "clientip": "198.46.149.143", + "@version": "1", + "beat": { + "name": "My-MacBook-Pro.local", + "hostname": "My-MacBook-Pro.local", + "version": "6.0.0" + }, + "host": "My-MacBook-Pro.local", + "httpversion": "1.1", + "timestamp": "04/Jan/2015:05:29:13 +0000" + } + }, + ... +``` + +If you are using Kibana to visualize your data, you can also explore the Filebeat data in Kibana: + +![Discovering Filebeat data in Kibana](images/kibana-filebeat-data.png) + +See the [Filebeat quick start docs](beats://reference/filebeat/filebeat-installation-configuration.md) for info about loading the Kibana index pattern for Filebeat. + +You’ve successfully created a pipeline that uses Filebeat to take Apache web logs as input, parses those logs to create specific, named fields from the logs, and writes the parsed data to an Elasticsearch cluster. Next, you learn how to create a pipeline that uses multiple input and output plugins. + + diff --git a/docs/static/pipeline-config-exps.asciidoc b/docs/reference/config-examples.md similarity index 64% rename from docs/static/pipeline-config-exps.asciidoc rename to docs/reference/config-examples.md index e13649659..966576d67 100644 --- a/docs/static/pipeline-config-exps.asciidoc +++ b/docs/reference/config-examples.md @@ -1,18 +1,23 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/config-examples.html +--- + +# Logstash configuration examples [config-examples] -[[config-examples]] -=== Logstash configuration examples These examples illustrate how you can configure Logstash to filter events, process Apache logs and syslog messages, and use conditionals to control what events are processed by a filter or output. -TIP: If you need help building grok patterns, try out the -{kibana-ref}/xpack-grokdebugger.html[Grok Debugger]. +::::{tip} +If you need help building grok patterns, try out the [Grok Debugger](docs-content://explore-analyze/query-filter/tools/grok-debugger.md). +:::: -[discrete] -[[filter-example]] -==== Configuring filters -Filters are an in-line processing mechanism that provide the flexibility to slice and dice your data to fit your needs. Let's take a look at some filters in action. The following configuration file sets up the `grok` and `date` filters. -[source,ruby] ----------------------------------- + +## Configuring filters [filter-example] + +Filters are an in-line processing mechanism that provide the flexibility to slice and dice your data to fit your needs. Let’s take a look at some filters in action. The following configuration file sets up the `grok` and `date` filters. + +```ruby input { stdin { } } filter { @@ -28,27 +33,23 @@ output { elasticsearch { hosts => ["localhost:9200"] } stdout { codec => rubydebug } } ----------------------------------- +``` Run Logstash with this configuration: -[source,ruby] ----------------------------------- +```ruby bin/logstash -f logstash-filter.conf ----------------------------------- +``` -Now, paste the following line into your terminal and press Enter so it will be -processed by the stdin input: +Now, paste the following line into your terminal and press Enter so it will be processed by the stdin input: -[source,ruby] ----------------------------------- +```ruby 127.0.0.1 - - [11/Dec/2013:00:01:45 -0800] "GET /xampp/status.php HTTP/1.1" 200 3891 "http://cadenza/xampp/navi.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:25.0) Gecko/20100101 Firefox/25.0" ----------------------------------- +``` You should see something returned to stdout that looks like this: -[source,ruby] ----------------------------------- +```ruby { "message" => "127.0.0.1 - - [11/Dec/2013:00:01:45 -0800] \"GET /xampp/status.php HTTP/1.1\" 200 3891 \"http://cadenza/xampp/navi.php\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:25.0) Gecko/20100101 Firefox/25.0\"", "@timestamp" => "2013-12-11T08:01:45.000Z", @@ -66,18 +67,18 @@ You should see something returned to stdout that looks like this: "referrer" => "\"http://cadenza/xampp/navi.php\"", "agent" => "\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:25.0) Gecko/20100101 Firefox/25.0\"" } ----------------------------------- +``` -As you can see, Logstash (with help from the `grok` filter) was able to parse the log line (which happens to be in Apache "combined log" format) and break it up into many different discrete bits of information. This is extremely useful once you start querying and analyzing our log data. For example, you'll be able to easily run reports on HTTP response codes, IP addresses, referrers, and so on. There are quite a few grok patterns included with Logstash out-of-the-box, so it's quite likely if you need to parse a common log format, someone has already done the work for you. For more information, see the list of https://github.com/logstash-plugins/logstash-patterns-core/tree/main/patterns[Logstash grok patterns] on GitHub. +As you can see, Logstash (with help from the `grok` filter) was able to parse the log line (which happens to be in Apache "combined log" format) and break it up into many different discrete bits of information. This is extremely useful once you start querying and analyzing our log data. For example, you’ll be able to easily run reports on HTTP response codes, IP addresses, referrers, and so on. There are quite a few grok patterns included with Logstash out-of-the-box, so it’s quite likely if you need to parse a common log format, someone has already done the work for you. For more information, see the list of [Logstash grok patterns](https://github.com/logstash-plugins/logstash-patterns-core/tree/main/patterns) on GitHub. -The other filter used in this example is the `date` filter. This filter parses out a timestamp and uses it as the timestamp for the event (regardless of when you're ingesting the log data). You'll notice that the `@timestamp` field in this example is set to December 11, 2013, even though Logstash is ingesting the event at some point afterwards. This is handy when backfilling logs. It gives you the ability to tell Logstash "use this value as the timestamp for this event". +The other filter used in this example is the `date` filter. This filter parses out a timestamp and uses it as the timestamp for the event (regardless of when you’re ingesting the log data). You’ll notice that the `@timestamp` field in this example is set to December 11, 2013, even though Logstash is ingesting the event at some point afterwards. This is handy when backfilling logs. It gives you the ability to tell Logstash "use this value as the timestamp for this event". -[discrete] -==== Processing Apache logs -Let's do something that's actually *useful*: process apache2 access log files! We are going to read the input from a file on the localhost, and use a <> to process the event according to our needs. First, create a file called something like 'logstash-apache.conf' with the following contents (you can change the log's file path to suit your needs): -[source,js] ----------------------------------- +## Processing Apache logs [_processing_apache_logs] + +Let’s do something that’s actually **useful**: process apache2 access log files! We are going to read the input from a file on the localhost, and use a [conditional](/reference/event-dependent-configuration.md#conditionals) to process the event according to our needs. First, create a file called something like *logstash-apache.conf* with the following contents (you can change the log’s file path to suit your needs): + +```js input { file { path => "/tmp/access_log" @@ -103,48 +104,43 @@ output { } stdout { codec => rubydebug } } - ----------------------------------- +``` Then, create the input file you configured above (in this example, "/tmp/access_log") with the following log entries (or use some from your own webserver): -[source,js] ----------------------------------- +```js 71.141.244.242 - kurt [18/May/2011:01:48:10 -0700] "GET /admin HTTP/1.1" 301 566 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" 134.39.72.245 - - [18/May/2011:12:40:18 -0700] "GET /favicon.ico HTTP/1.1" 200 1189 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)" 98.83.179.51 - - [18/May/2011:19:35:08 -0700] "GET /css/main.css HTTP/1.1" 200 1837 "http://www.safesand.com/information.htm" "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" ----------------------------------- +``` Now, run Logstash with the -f flag to pass in the configuration file: -[source,js] ----------------------------------- +```js bin/logstash -f logstash-apache.conf ----------------------------------- +``` -Now you should see your apache log data in Elasticsearch! Logstash opened and read the specified input file, processing each event it encountered. Any additional lines logged to this file will also be captured, processed by Logstash as events, and stored in Elasticsearch. As an added bonus, they are stashed with the field "type" set to "apache_access" (this is done by the type => "apache_access" line in the input configuration). +Now you should see your apache log data in Elasticsearch! Logstash opened and read the specified input file, processing each event it encountered. Any additional lines logged to this file will also be captured, processed by Logstash as events, and stored in Elasticsearch. As an added bonus, they are stashed with the field "type" set to "apache_access" (this is done by the type ⇒ "apache_access" line in the input configuration). -In this configuration, Logstash is only watching the apache access_log, but it's easy enough to watch both the access_log and the error_log (actually, any file matching `*log`), by changing one line in the above configuration: +In this configuration, Logstash is only watching the apache access_log, but it’s easy enough to watch both the access_log and the error_log (actually, any file matching `*log`), by changing one line in the above configuration: -[source,js] ----------------------------------- +```js input { file { path => "/tmp/*_log" ... ----------------------------------- +``` -When you restart Logstash, it will process both the error and access logs. However, if you inspect your data (using elasticsearch-kopf, perhaps), you'll see that the access_log is broken up into discrete fields, but the error_log isn't. That's because we used a `grok` filter to match the standard combined apache log format and automatically split the data into separate fields. Wouldn't it be nice *if* we could control how a line was parsed, based on its format? Well, we can... +When you restart Logstash, it will process both the error and access logs. However, if you inspect your data (using elasticsearch-kopf, perhaps), you’ll see that the access_log is broken up into discrete fields, but the error_log isn’t. That’s because we used a `grok` filter to match the standard combined apache log format and automatically split the data into separate fields. Wouldn’t it be nice **if** we could control how a line was parsed, based on its format? Well, we can…​ Note that Logstash did not reprocess the events that were already seen in the access_log file. When reading from a file, Logstash saves its position and only processes new lines as they are added. Neat! -[discrete] -[[using-conditionals]] -==== Using conditionals + +## Using conditionals [using-conditionals] + You use conditionals to control what events are processed by a filter or output. For example, you could label each event according to which file it appeared in (access_log, error_log, and other random files that end with "log"). -[source,ruby] ----------------------------------- +```ruby input { file { path => "/tmp/*_log" @@ -171,9 +167,9 @@ output { elasticsearch { hosts => ["localhost:9200"] } stdout { codec => rubydebug } } ----------------------------------- +``` -This example labels all events using the `type` field, but doesn't actually parse the `error` or `random` files. There are so many types of error logs that how they should be labeled really depends on what logs you're working with. +This example labels all events using the `type` field, but doesn’t actually parse the `error` or `random` files. There are so many types of error logs that how they should be labeled really depends on what logs you’re working with. Similarly, you can use conditionals to direct events to particular outputs. For example, you could: @@ -181,14 +177,9 @@ Similarly, you can use conditionals to direct events to particular outputs. For * record any 4xx status to Elasticsearch * record all status code hits via statsd -To tell nagios about any http event that has a 5xx status code, you -first need to check the value of the `type` field. If it's apache, then you can -check to see if the `status` field contains a 5xx error. If it is, send it to nagios. If it isn't -a 5xx error, check to see if the `status` field contains a 4xx error. If so, send it to Elasticsearch. -Finally, send all apache status codes to statsd no matter what the `status` field contains: +To tell nagios about any http event that has a 5xx status code, you first need to check the value of the `type` field. If it’s apache, then you can check to see if the `status` field contains a 5xx error. If it is, send it to nagios. If it isn’t a 5xx error, check to see if the `status` field contains a 4xx error. If so, send it to Elasticsearch. Finally, send all apache status codes to statsd no matter what the `status` field contains: -[source,js] ----------------------------------- +```js output { if [type] == "apache" { if [status] =~ /^5\d\d/ { @@ -199,16 +190,16 @@ output { statsd { increment => "apache.%{status}" } } } ----------------------------------- +``` -[discrete] -==== Processing Syslog messages -Syslog is one of the most common use cases for Logstash, and one it handles exceedingly well (as long as the log lines conform roughly to RFC3164). Syslog is the de facto UNIX networked logging standard, sending messages from client machines to a local file, or to a centralized log server via rsyslog. For this example, you won't need a functioning syslog instance; we'll fake it from the command line so you can get a feel for what happens. -First, let's make a simple configuration file for Logstash + syslog, called 'logstash-syslog.conf'. +## Processing Syslog messages [_processing_syslog_messages] -[source,ruby] ----------------------------------- +Syslog is one of the most common use cases for Logstash, and one it handles exceedingly well (as long as the log lines conform roughly to RFC3164). Syslog is the de facto UNIX networked logging standard, sending messages from client machines to a local file, or to a centralized log server via rsyslog. For this example, you won’t need a functioning syslog instance; we’ll fake it from the command line so you can get a feel for what happens. + +First, let’s make a simple configuration file for Logstash + syslog, called *logstash-syslog.conf*. + +```ruby input { tcp { port => 5000 @@ -237,36 +228,32 @@ output { elasticsearch { hosts => ["localhost:9200"] } stdout { codec => rubydebug } } ----------------------------------- +``` Run Logstash with this new configuration: -[source,ruby] ----------------------------------- +```ruby bin/logstash -f logstash-syslog.conf ----------------------------------- +``` -Normally, a client machine would connect to the Logstash instance on port 5000 and send its message. For this example, we'll just telnet to Logstash and enter a log line (similar to how we entered log lines into STDIN earlier). Open another shell window to interact with the Logstash syslog input and enter the following command: +Normally, a client machine would connect to the Logstash instance on port 5000 and send its message. For this example, we’ll just telnet to Logstash and enter a log line (similar to how we entered log lines into STDIN earlier). Open another shell window to interact with the Logstash syslog input and enter the following command: -[source,ruby] ----------------------------------- +```ruby telnet localhost 5000 ----------------------------------- +``` Copy and paste the following lines as samples. (Feel free to try some of your own, but keep in mind they might not parse if the `grok` filter is not correct for your data). -[source,ruby] ----------------------------------- +```ruby Dec 23 12:11:43 louis postfix/smtpd[31499]: connect from unknown[95.75.93.154] Dec 23 14:42:56 louis named[16000]: client 199.48.164.7#64817: query (cache) 'amsterdamboothuren.com/MX/IN' denied Dec 23 14:30:01 louis CRON[619]: (www-data) CMD (php /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log) Dec 22 18:28:06 louis rsyslogd: [origin software="rsyslogd" swVersion="4.2.0" x-pid="2253" x-info="http://www.rsyslog.com"] rsyslogd was HUPed, type 'lightweight'. ----------------------------------- +``` Now you should see the output of Logstash in your original shell as it processes and parses messages! -[source,ruby] ----------------------------------- +```ruby { "message" => "Dec 23 14:30:01 louis CRON[619]: (www-data) CMD (php /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log)", "@timestamp" => "2013-12-23T22:30:01.000Z", @@ -285,7 +272,5 @@ Now you should see the output of Logstash in your original shell as it processes "syslog_facility" => "user-level", "syslog_severity" => "notice" } ----------------------------------- - - +``` diff --git a/docs/reference/config-setting-files.md b/docs/reference/config-setting-files.md new file mode 100644 index 000000000..5ace59d73 --- /dev/null +++ b/docs/reference/config-setting-files.md @@ -0,0 +1,33 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/config-setting-files.html +--- + +# Logstash Configuration Files [config-setting-files] + +Logstash has two types of configuration files: *pipeline configuration files*, which define the Logstash processing pipeline, and *settings files*, which specify options that control Logstash startup and execution. + +## Pipeline Configuration Files [pipeline-config-files] + +You create pipeline configuration files when you define the stages of your Logstash processing pipeline. On deb and rpm, you place the pipeline configuration files in the `/etc/logstash/conf.d` directory. Logstash tries to load only files with `.conf` extension in the `/etc/logstash/conf.d directory` and ignores all other files. + +See [*Creating a {{ls}} pipeline*](/reference/creating-logstash-pipeline.md) for more info. + + +## Settings Files [settings-files] + +The settings files are already defined in the Logstash installation. Logstash includes the following settings files: + +**`logstash.yml`** +: Contains Logstash configuration flags. You can set flags in this file instead of passing the flags at the command line. Any flags that you set at the command line override the corresponding settings in the `logstash.yml` file. See [logstash.yml](/reference/logstash-settings-file.md) for more info. + +**`pipelines.yml`** +: Contains the framework and instructions for running multiple pipelines in a single Logstash instance. See [Multiple Pipelines](/reference/multiple-pipelines.md) for more info. + +**`jvm.options`** +: Contains JVM configuration flags. Use this file to set initial and maximum values for total heap space. You can also use this file to set the locale for Logstash. Specify each flag on a separate line. All other settings in this file are considered expert settings. + +**`log4j2.properties`** +: Contains default settings for `log4j 2` library. See [Log4j2 configuration](/reference/logging.md#log4j2) for more info. + + diff --git a/docs/reference/configuration-file-structure.md b/docs/reference/configuration-file-structure.md new file mode 100644 index 000000000..5b0ee2072 --- /dev/null +++ b/docs/reference/configuration-file-structure.md @@ -0,0 +1,235 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html +--- + +# Structure of a pipeline [configuration-file-structure] + +A {{ls}} pipeline config file has a separate section for each type of plugin you want to add to the event processing pipeline. For example: + +```js +# This is a comment. You should use comments to describe +# parts of your configuration. +input { + ... +} + +filter { + ... +} + +output { + ... +} +``` + +Each section contains configuration options for one or more plugins. If you specify multiple filters, they are applied in the order they appear in the configuration file. If you specify multiple outputs, events are sent to each destination sequentially, in the order they appear in the configuration file. + +::::{tip} +When you are ready to deploy a pipeline beyond your local machine, add the pipeline config file to [`logstash.yml`](/reference/logstash-settings-file.md) using the `pipeline.id` setting. When you are ready to deploy [multiple pipelines](/reference/multiple-pipelines.md), set up and configure your pipelines in the `pipelines.yml` file. +:::: + + + +## Plugin configuration [plugin_configuration] + +A plugin configuration consists of the plugin name followed by a block of settings for that plugin. For example, this input section configures two file inputs: + +```js +input { + http { + port => 3333 + tags => gateway + } + http { + port => 4444 + tags => billing + } +} +``` + +In this example, two settings are configured for each of the file inputs: *port* and *tags*. + +The settings you can configure vary according to the plugin type. For information about each plugin, see [Input Plugins](logstash-docs-md://lsr/input-plugins.md), [Output Plugins](logstash-docs-md://lsr/output-plugins.md), [Filter Plugins](logstash-docs-md://lsr/filter-plugins.md), and [Codec Plugins](logstash-docs-md://lsr/codec-plugins.md). + + +## Value types [plugin-value-types] + +A plugin can require that the value for a setting be a certain type, such as boolean, list, or hash. The following value types are supported. + +## Array [array] + +This type is now mostly deprecated in favor of using a standard type like `string` with the plugin defining the `:list => true` property for better type checking. It is still needed to handle lists of hashes or mixed types where type checking is not desired. + +Example: + +```js + users => [ {id => 1, name => bob}, {id => 2, name => jane} ] +``` + + +### Lists [list] + +Not a type in and of itself, but a property types can have. This makes it possible to type check multiple values. Plugin authors can enable list checking by specifying `:list => true` when declaring an argument. + +Example: + +```js + path => [ "/var/log/messages", "/var/log/*.log" ] + uris => [ "http://elastic.co", "http://example.net" ] +``` + +This example configures `path`, which is a `string` to be a list that contains an element for each of the three strings. It also will configure the `uris` parameter to be a list of URIs, failing if any of the URIs provided are not valid. + + +### Boolean [boolean] + +A boolean must be either `true` or `false`. Note that the `true` and `false` keywords are not enclosed in quotes. + +Example: + +```js + ssl_enable => true +``` + + +### Bytes [bytes] + +A bytes field is a string field that represents a valid unit of bytes. It is a convenient way to declare specific sizes in your plugin options. Both SI (k M G T P E Z Y) and Binary (Ki Mi Gi Ti Pi Ei Zi Yi) units are supported. Binary units are in base-1024 and SI units are in base-1000. This field is case-insensitive and accepts space between the value and the unit. If no unit is specified, the integer string represents the number of bytes. + +Examples: + +```js + my_bytes => "1113" # 1113 bytes + my_bytes => "10MiB" # 10485760 bytes + my_bytes => "100kib" # 102400 bytes + my_bytes => "180 mb" # 180000000 bytes +``` + + +### Codec [codec] + +A codec is the name of Logstash codec used to represent the data. Codecs can be used in both inputs and outputs. + +Input codecs provide a convenient way to decode your data before it enters the input. Output codecs provide a convenient way to encode your data before it leaves the output. Using an input or output codec eliminates the need for a separate filter in your Logstash pipeline. + +A list of available codecs can be found at the [Codec Plugins](logstash-docs-md://lsr/codec-plugins.md) page. + +Example: + +```js + codec => "json" +``` + + +### Hash [hash] + +A hash is a collection of key value pairs specified in the format `"field1" => "value1"`. Note that multiple key value entries are separated by spaces rather than commas. + +Example: + +```js +match => { + "field1" => "value1" + "field2" => "value2" + ... +} +# or as a single line. No commas between entries: +match => { "field1" => "value1" "field2" => "value2" } +``` + + +### Number [number] + +Numbers must be valid numeric values (floating point or integer). + +Example: + +```js + port => 33 +``` + + +### Password [password] + +A password is a string with a single value that is not logged or printed. + +Example: + +```js + my_password => "password" +``` + + +### URI [uri] + +A URI can be anything from a full URL like *http://elastic.co/* to a simple identifier like *foobar*. If the URI contains a password such as *http://user:pass@example.net* the password portion of the URI will not be logged or printed. + +Example: + +```js + my_uri => "http://foo:bar@example.net" +``` + + +### Path [path] + +A path is a string that represents a valid operating system path. + +Example: + +```js + my_path => "/tmp/logstash" +``` + + +### String [string] + +A string must be a single character sequence. Note that string values are enclosed in quotes, either double or single. + +### Escape sequences [_escape_sequences] + +By default, escape sequences are not enabled. If you wish to use escape sequences in quoted strings, you will need to set `config.support_escapes: true` in your `logstash.yml`. When `true`, quoted strings (double and single) will have this transformation: + +| | | +| --- | --- | +| Text | Result | +| \r | carriage return (ASCII 13) | +| \n | new line (ASCII 10) | +| \t | tab (ASCII 9) | +| \\ | backslash (ASCII 92) | +| \" | double quote (ASCII 34) | +| \' | single quote (ASCII 39) | + +Example: + +```js + name => "Hello world" + name => 'It\'s a beautiful day' +``` + + +### Field reference [field-reference] + +A Field Reference is a special [String](#string) value representing the path to a field in an event, such as `@timestamp` or `[@timestamp]` to reference a top-level field, or `[client][ip]` to access a nested field. The [*Field References Deep Dive*](https://www.elastic.co/guide/en/logstash/current/field-references-deepdive.html) provides detailed information about the structure of Field References. When provided as a configuration option, Field References need to be quoted and special characters must be escaped following the same rules as [String](#string). + + +## Comments [comments] + +Comments are the same as in perl, ruby, and python. A comment starts with a *#* character, and does not need to be at the beginning of a line. For example: + +```js +# this is a comment + +input { # comments can appear at the end of a line, too + # ... +} +``` + +::::{note} +Comments containing environment variable `${var}` references in `config.string` are still evaluated. Remove the `$` sign to avoid pipeline loading failures. +:::: + + + + diff --git a/docs/reference/configuring-centralized-pipelines.md b/docs/reference/configuring-centralized-pipelines.md new file mode 100644 index 000000000..fc56a4a4f --- /dev/null +++ b/docs/reference/configuring-centralized-pipelines.md @@ -0,0 +1,157 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/configuring-centralized-pipelines.html +--- + +# Configure Centralized Pipeline Management [configuring-centralized-pipelines] + +To configure [centralized pipeline management](/reference/logstash-centralized-pipeline-management.md): + +1. Verify that you are using a license that includes the pipeline management feature. + + For more information, see [https://www.elastic.co/subscriptions](https://www.elastic.co/subscriptions) and [License management](docs-content://deploy-manage/license/manage-your-license-in-self-managed-cluster.md). + +2. Specify [configuration management settings](#configuration-management-settings) in the `logstash.yml` file. At a minimum, set: + + * `xpack.management.enabled: true` to enable centralized configuration management. + * `xpack.management.elasticsearch.hosts` to specify the Elasticsearch instance that will store the Logstash pipeline configurations and metadata. + * `xpack.management.pipeline.id` to register the pipelines that you want to centrally manage. + +3. Restart Logstash. +4. If your Elasticsearch cluster is protected with basic authentication, assign the built-in `logstash_admin` role as well as the `logstash_writer` role to any users who will use centralized pipeline management. See [Secure your connection](/reference/secure-connection.md) for more information. + +::::{note} +Centralized management is disabled until you configure and enable {{security-features}}. +:::: + + +::::{important} +After you’ve configured Logstash to use centralized pipeline management, you can no longer specify local pipeline configurations. This means that the `pipelines.yml` file and settings like `path.config` and `config.string` are inactive when this feature is enabled. +:::: + + +## Configuration Management Settings in Logstash [configuration-management-settings] + + +You can set the following `xpack.management` settings in `logstash.yml` to enable [centralized pipeline management](/reference/logstash-centralized-pipeline-management.md). For more information about configuring Logstash, see [logstash.yml](/reference/logstash-settings-file.md). + +The following example shows basic settings that assume {{es}} and {{kib}} are installed on the localhost with basic AUTH enabled, but no SSL. If you’re using SSL, you need to specify additional SSL settings. + +```shell +xpack.management.enabled: true +xpack.management.elasticsearch.hosts: "http://localhost:9200/" +xpack.management.elasticsearch.username: logstash_admin_user +xpack.management.elasticsearch.password: t0p.s3cr3t +xpack.management.logstash.poll_interval: 5s +xpack.management.pipeline.id: ["apache", "cloudwatch_logs"] +``` + +`xpack.management.enabled` +: Set to `true` to enable {{xpack}} centralized configuration management for Logstash. + +`xpack.management.logstash.poll_interval` +: How often the Logstash instance polls for pipeline changes from Elasticsearch. The default is 5s. + +`xpack.management.pipeline.id` +: Specify a comma-separated list of pipeline IDs to register for centralized pipeline management. After changing this setting, you need to restart Logstash to pick up changes. Pipeline IDs support `*` as a [wildcard](#wildcard-in-pipeline-id) for matching multiple IDs + +`xpack.management.elasticsearch.hosts` +: The {{es}} instance that will store the Logstash pipeline configurations and metadata. This might be the same {{es}} instance specified in the `outputs` section in your Logstash configuration, or a different one. Defaults to `http://localhost:9200`. + +`xpack.management.elasticsearch.username` and `xpack.management.elasticsearch.password` +: If your {{es}} cluster is protected with basic authentication, these settings provide the username and password that the Logstash instance uses to authenticate for accessing the configuration data. The username you specify here should have the built-in `logstash_admin` and `logstash_system` roles. These roles provide access to system indices for managing configurations. + +::::{note} +Starting with Elasticsearch version 7.10.0, the `logstash_admin` role inherits the `manage_logstash_pipelines` cluster privilege for centralized pipeline management. If a user has created their own roles and granted them access to the .logstash index, those roles will continue to work in 7.x but will need to be updated for 8.0. +:::: + + +`xpack.management.elasticsearch.proxy` +: Optional setting that allows you to specify a proxy URL if Logstash needs to use a proxy to reach your Elasticsearch cluster. + +`xpack.management.elasticsearch.ssl.ca_trusted_fingerprint` +: Optional setting that enables you to specify the hex-encoded SHA-256 fingerprint of the certificate authority for your {{es}} instance. + +::::{note} +A self-secured Elasticsearch cluster will provide the fingerprint of its CA to the console during setup. + +You can also get the SHA256 fingerprint of an Elasticsearch’s CA using the `openssl` command-line utility on the Elasticsearch host: + +```shell +openssl x509 -fingerprint -sha256 -in $ES_HOME/config/certs/http_ca.crt +``` + +:::: + + +`xpack.management.elasticsearch.ssl.certificate_authority` +: Optional setting that enables you to specify a path to the `.pem` file for the certificate authority for your {{es}} instance. + +`xpack.management.elasticsearch.ssl.truststore.path` +: Optional setting that provides the path to the Java keystore (JKS) to validate the server’s certificate. + +::::{note} +You cannot use this setting and `xpack.management.elasticsearch.ssl.certificate_authority` at the same time. +:::: + + +`xpack.management.elasticsearch.ssl.truststore.password` +: Optional setting that provides the password to the truststore. + +`xpack.management.elasticsearch.ssl.keystore.path` +: Optional setting that provides the path to the Java keystore (JKS) to validate the client’s certificate. + +::::{note} +You cannot use this setting and `xpack.management.elasticsearch.ssl.keystore.certificate` at the same time. +:::: + + +`xpack.management.elasticsearch.ssl.keystore.password` +: Optional setting that provides the password to the keystore. + +`xpack.management.elasticsearch.ssl.certificate` +: Optional setting that provides the path to an SSL certificate to use to authenticate the client. This certificate should be an OpenSSL-style X.509 certificate file. + +::::{note} +This setting can be used only if `xpack.management.elasticsearch.ssl.key` is set. +:::: + + +`xpack.management.elasticsearch.ssl.key` +: Optional setting that provides the path to an OpenSSL-style RSA private key that corresponds to the `xpack.management.elasticsearch.ssl.certificate`. + +::::{note} +This setting can be used only if `xpack.management.elasticsearch.ssl.certificate` is set. +:::: + + +`xpack.management.elasticsearch.ssl.verification_mode` +: Option to validate the server’s certificate. Defaults to `full`. To disable, set to `none`. Disabling this severely compromises security. + +`xpack.management.elasticsearch.ssl.cipher_suites` +: Optional setting that provides the list of cipher suites to use, listed by priorities. Supported cipher suites vary depending on the Java and protocol versions. + +`xpack.management.elasticsearch.cloud_id` +: If you’re using {{es}} in {{ecloud}}, you should specify the identifier here. This setting is an alternative to `xpack.management.elasticsearch.hosts`. If `cloud_id` is configured, `xpack.management.elasticsearch.hosts` should not be used. This {{es}} instance will store the Logstash pipeline configurations and metadata. + +`xpack.management.elasticsearch.cloud_auth` +: If you’re using {{es}} in {{ecloud}}, you can set your auth credentials here. This setting is an alternative to both `xpack.management.elasticsearch.username` and `xpack.management.elasticsearch.password`. If `cloud_auth` is configured, those settings should not be used. The credentials you specify here should be for a user with the `logstash_admin` and `logstash_system` roles, which provide access to system indices for managing configurations. + +`xpack.management.elasticsearch.api_key` +: Authenticate using an Elasticsearch API key. Note that this option also requires using SSL. The API key Format is `id:api_key` where `id` and `api_key` are as returned by the Elasticsearch [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key). + + +## Wildcard support in pipeline ID [wildcard-in-pipeline-id] + + +Pipeline IDs must begin with a letter or underscore and contain only letters, underscores, dashes, and numbers. You can use `*` in `xpack.management.pipeline.id` to match any number of letters, underscores, dashes, and numbers. + +```shell +xpack.management.pipeline.id: ["*logs", "*apache*", "tomcat_log"] +``` + +In this example, `"*logs"` matches all IDs ending in `logs`. `"*apache*"` matches any IDs with `apache` in the name. + +Wildcard in pipeline IDs is available starting with Elasticsearch 7.10. Logstash can pick up new pipeline without a restart if the new pipeline ID matches the wildcard pattern. + + diff --git a/docs/reference/configuring-geoip-database-management.md b/docs/reference/configuring-geoip-database-management.md new file mode 100644 index 000000000..df0f84a2a --- /dev/null +++ b/docs/reference/configuring-geoip-database-management.md @@ -0,0 +1,68 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/configuring-geoip-database-management.html +--- + +# Configure GeoIP Database Management [configuring-geoip-database-management] + +To configure [GeoIP Database Management](/reference/logstash-geoip-database-management.md): + +1. Verify that you are using a license that includes the geoip database management feature. + + For more information, see [https://www.elastic.co/subscriptions](https://www.elastic.co/subscriptions) and [License management](docs-content://deploy-manage/license/manage-your-license-in-self-managed-cluster.md). + +2. Specify [geoip database management settings](#geoip-database-management-settings) in the `logstash.yml` file to tune the configuration as-needed. + +## GeoIP database Management settings in {{ls}} [geoip-database-management-settings] + + +You can set the following `xpack.geoip` settings in `logstash.yml` to configure the [geoip database manager](/reference/logstash-geoip-database-management.md). For more information about configuring Logstash, see [logstash.yml](/reference/logstash-settings-file.md). + +`xpack.geoip.downloader.enabled` +: (Boolean) If `true`, Logstash automatically downloads and manages updates for GeoIP2 databases from the `xpack.geoip.downloader.endpoint`. If `false`, Logstash does not manage GeoIP2 databases and plugins that need a GeoIP2 database must be configured to provide their own. + +`xpack.geoip.downloader.endpoint` +: (String) Endpoint URL used to download updates for GeoIP2 databases. For example, `https://mydomain.com/overview.json`. Defaults to `https://geoip.elastic.co/v1/database`. Note that Logstash will periodically make a GET request to `${xpack.geoip.downloader.endpoint}?elastic_geoip_service_tos=agree`, expecting the list of metadata about databases typically found in `overview.json`. + +`xpack.geoip.downloader.poll.interval` +: (Time Value) How often Logstash checks for GeoIP2 database updates at the `xpack.geoip.downloader.endpoint`. For example, `6h` to check every six hours. Defaults to `24h` (24 hours). + + +## Offline and air-gapped environments [configuring-geoip-database-management-offline] + +If Logstash does not have access to the internet, or if you want to disable the database manager, set the `xpack.geoip.downloader.enabled` value to `false` in `logstash.yml`. When the database manager is disabled, plugins that require GeoIP lookups must be configured with their own source of GeoIP databases. + +### Using an HTTP proxy [_using_an_http_proxy] + +If you can’t connect directly to the Elastic GeoIP endpoint, consider setting up an HTTP proxy server. You can then specify the proxy with `http_proxy` environment variable. + +```sh +export http_proxy="http://PROXY_IP:PROXY_PORT" +``` + + +### Using a custom endpoint [_using_a_custom_endpoint] + +If you work in an air-gapped environment and can’t update your databases from the Elastic endpoint, You can then download databases from MaxMind and bootstrap the service. + +1. Download both `GeoLite2-ASN.mmdb` and `GeoLite2-City.mmdb` database files from the [MaxMind site](http://dev.maxmind.com/geoip/geoip2/geolite2). +2. Copy both database files to a single directory. +3. [Download {{es}}](https://www.elastic.co/downloads/elasticsearch). +4. From your {{es}} directory, run: + + ```sh + ./bin/elasticsearch-geoip -s my/database/dir + ``` + +5. Serve the static database files from your directory. For example, you can use Docker to serve the files from nginx server: + + ```sh + docker run -p 8080:80 -v my/database/dir:/usr/share/nginx/html:ro nginx + ``` + +6. Specify the service’s endpoint URL in Logstash using the `xpack.geoip.download.endpoint=http://localhost:8080/overview.json` setting in `logstash.yml`. + +Logstash gets automatic updates from this service. + + + diff --git a/docs/reference/connecting-to-cloud.md b/docs/reference/connecting-to-cloud.md new file mode 100644 index 000000000..34397c27f --- /dev/null +++ b/docs/reference/connecting-to-cloud.md @@ -0,0 +1,47 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/logstash/current/connecting-to-cloud.html +--- + +# Sending data to Elastic Cloud (hosted Elasticsearch Service) [connecting-to-cloud] + +Our hosted {{ess}} on [Elastic Cloud](https://cloud.elastic.co/) simplifies safe, secure communication between {{ls}} and {{es}}. When you configure the Elasticsearch output plugin to use [`cloud_id`](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md#plugins-outputs-elasticsearch-cloud_id) with either the [`cloud_auth` option](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md#plugins-outputs-elasticsearch-cloud_auth) or the [`api_key` option](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md#plugins-outputs-elasticsearch-api_key), no additional SSL configuration is needed. + +Examples: + +* `output {elasticsearch { cloud_id => "" cloud_auth => "" } }` +* `output {elasticsearch { cloud_id => "" api_key => "" } }` + +{ess-leadin-short} + +## Cloud ID [cloud-id] + +{{ls}} uses the Cloud ID, found in the Elastic Cloud web console, to build the Elasticsearch and Kibana hosts settings. It is a base64 encoded text value of about 120 characters made up of upper and lower case letters and numbers. If you have several Cloud IDs, you can add a label, which is ignored internally, to help you tell them apart. To add a label you should prefix your Cloud ID with a label and a `:` separator in this format "