diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc
index ef691156598..0bbf33322e0 100644
--- a/CHANGELOG.next.asciidoc
+++ b/CHANGELOG.next.asciidoc
@@ -653,6 +653,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add SSL option to checkpoint module {pull}19560[19560]
- Add max_number_of_messages config into s3 input. {pull}21993[21993]
- Update Okta documentation for new stateful restarts. {pull}22091[22091]
+- Rename google-pubsub input to gcp-pubsub. {pull}22213[22213]
- Copy tag names from MISP data into events. {pull}21664[21664]
- Added TLS JA3 fingerprint, certificate not_before/not_after, certificate SHA1 hash, and certificate subject fields to Zeek SSL dataset. {pull}21696[21696]
diff --git a/filebeat/docs/filebeat-options.asciidoc b/filebeat/docs/filebeat-options.asciidoc
index 4cfa0961a20..edafda17bb4 100644
--- a/filebeat/docs/filebeat-options.asciidoc
+++ b/filebeat/docs/filebeat-options.asciidoc
@@ -66,7 +66,7 @@ You can configure {beatname_uc} to use the following inputs:
* <<{beatname_lc}-input-cloudfoundry>>
* <<{beatname_lc}-input-container>>
* <<{beatname_lc}-input-docker>>
-* <<{beatname_lc}-input-google-pubsub>>
+* <<{beatname_lc}-input-gcp-pubsub>>
* <<{beatname_lc}-input-http_endpoint>>
* <<{beatname_lc}-input-httpjson>>
* <<{beatname_lc}-input-kafka>>
@@ -96,7 +96,7 @@ include::inputs/input-docker.asciidoc[]
include::inputs/input-filestream.asciidoc[]
-include::../../x-pack/filebeat/docs/inputs/input-google-pubsub.asciidoc[]
+include::../../x-pack/filebeat/docs/inputs/input-gcp-pubsub.asciidoc[]
include::../../x-pack/filebeat/docs/inputs/input-http-endpoint.asciidoc[]
diff --git a/x-pack/elastic-agent/pkg/agent/program/supported.go b/x-pack/elastic-agent/pkg/agent/program/supported.go
index adc13938ae2..67e094a2074 100644
--- a/x-pack/elastic-agent/pkg/agent/program/supported.go
+++ b/x-pack/elastic-agent/pkg/agent/program/supported.go
@@ -21,7 +21,7 @@ func init() {
// spec/filebeat.yml
// spec/heartbeat.yml
// spec/metricbeat.yml
- unpacked := packer.MustUnpack("eJy8WF1zozoSfd+fMa93axdEnF226j4YUnzFJmOSSEJvSLIBW2DfALbx1v73LQHmw0lm7uxszcOUByKk7lb36XP631+Kw5r9fZ3zwz7Ny7/Vmfjyry80s0ryso8DNNsxWz/QfBW/Arjl2DtwZ/cYAnX3lBqCZsGJAlFxU70Q5KssE8p6dUhYHhxIZm35wz4mwx4lsSEwc1+wnBxC8HrvPoTa00P8GIJEhKDcRGh24bZV0If94+LZEGsbbjEgB2q/3pvpPHZN4xTiYP+UztPxvmywLe3WJSzjl6d4H7vmPF48z1OewTpCZOZ277gtSoJ0Vdq4vMwfma1fuCX385UQnYuneF+6NrwjyN+QTBTkZf8ov3MdI+F2fO+a3sf+P7vtOtuqibbs7J6Xrun1e7sjuxbPqspsXocoEDfva4L9I8feluBlOtrnk3Mn66t1Jk4f+epv5yczN2oCdZVmomJakFD7dG+mSkxwIkJVzyJ0FtfYMdtSood97GawIo5xjNBMWWBfhBqsIxz08Qyxl7NLF6NrzNHsnc/vbfFUasNLG29yWFv6hTueCJFy7zqlbnbvqRMIJnQQorNK8DWuxoWgswi14Mi2+zhCsxPHwaX72xvBu3vXCWbMfu3ujiTUgWKwUxnn52MTg0wU3IY11m7WOr6gNtxyW6+fUuNAc0PlzrK761KsX5pcT8LsLMi88zWzCo7gKA8NheVQND5d92tyLjj28QawIMhXqOZdnlKDErkfXlUh8rcE+xcMrFMEdelb4dqkIAgqi6w8hJlVhVCZ5mj/d+sUrZqaKkM8v6klI6M2FLyzmeWwGOI7L13HExTpgLRnXt83/yIAZ0+pkYTAF0zzNyE2DhiUYr3q/a0JUo88g5tmbefjOGYREGmIZsnknrfvYz65szYm/fP03uela+sqdwz16lNjByYHBsSRxvtHDhJBt/uY2rAiWrB/NIN/tHsG+uPz/Df3YR6HaLZz7bOgGVciM96tgaiYAxWmKQf34S5emkZCs1Uc2dblGcCZ3INqUJFr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YTbIgtbEt4UFKv1kuCgjpDfFZhxZFowmeW1SdGSksksbTJfUo/EaWYPFTEbYiYFQ7VGaj87kiJBxpvg1b0EGgqCppgX2erINHGRILXIRUnNmSSBV9HyOMw0Pi74cbOK0GxHcHxtig2heUqNq4+XtgGJKsqa2U1HotQNc7xjCOCFAb0vHgpmmxDoFcnOh1bEiooBWHNLT0ge9KSlF6NdvnUCoZa5Q1E/+8xYppfvRUJwHN75V3s6O9WEPdzMLT8QPp+IjS3VjBkGVkGtT0Rde/Zw5ggc3vs+O9KesLTEf237gjmrpjn1gqlu6uLQic0+V9sBxkQ8pnh1Y6sWHDE4H5i2ms6prqJsdEcTgflDfvR3mBJEGjD7xcLxHUHHGj9wO9mwDOYEJ/2Q4QNS3jal9O5tAToc05a7bxLAX0saf1IUw8+b9LdEsuPJGl8/Puirr+3g5rdFWhzex6hrpPKMh33sjWfLrYCrQqSKqejqiO1k7TDwkPjN0VkMhFRNIgA3Ifbq8Hbe2uVIjxOgJ7KjXLna7IuhMf8ZcTn67kfE7M3M+9cK4Ob5Mp4F/yoRfSP+/8+CZ8ox5Le3uUVy7zjOhYajSM7xvjf0ffJHxNNk3+FuOwI2mr2PSN3HAmriS3XN958SUa1w6oned0XUf/7y3wAAAP//HFXAOw==")
SupportedMap = make(map[string]Spec)
for f, v := range unpacked {
diff --git a/x-pack/elastic-agent/spec/filebeat.yml b/x-pack/elastic-agent/spec/filebeat.yml
index aa09b4f9121..2472f2b5220 100644
--- a/x-pack/elastic-agent/spec/filebeat.yml
+++ b/x-pack/elastic-agent/spec/filebeat.yml
@@ -64,7 +64,7 @@ rules:
- cloudfoundry
- container
- docker
- - google-pubsub
+ - gcp-pubsub
- http_endpoint
- httpjson
- kafka
diff --git a/x-pack/filebeat/_meta/config/filebeat.inputs.reference.xpack.yml.tmpl b/x-pack/filebeat/_meta/config/filebeat.inputs.reference.xpack.yml.tmpl
index f083b4c814b..c5351be3339 100644
--- a/x-pack/filebeat/_meta/config/filebeat.inputs.reference.xpack.yml.tmpl
+++ b/x-pack/filebeat/_meta/config/filebeat.inputs.reference.xpack.yml.tmpl
@@ -30,7 +30,7 @@
#---------------------------- Google Cloud Pub/Sub Input -----------------------
# Input for reading messages from a Google Cloud Pub/Sub topic subscription.
-- type: google-pubsub
+- type: gcp-pubsub
enabled: false
# Google Cloud project ID. Required.
diff --git a/x-pack/filebeat/docs/inputs/input-google-pubsub.asciidoc b/x-pack/filebeat/docs/inputs/input-gcp-pubsub.asciidoc
similarity index 90%
rename from x-pack/filebeat/docs/inputs/input-google-pubsub.asciidoc
rename to x-pack/filebeat/docs/inputs/input-gcp-pubsub.asciidoc
index c03a3327602..8545065416f 100644
--- a/x-pack/filebeat/docs/inputs/input-google-pubsub.asciidoc
+++ b/x-pack/filebeat/docs/inputs/input-gcp-pubsub.asciidoc
@@ -1,15 +1,15 @@
[role="xpack"]
-:type: google-pubsub
+:type: gcp-pubsub
[id="{beatname_lc}-input-{type}"]
-=== Google Cloud Pub/Sub input
+=== GCP Pub/Sub input
++++
-Google Pub/Sub
+GCP Pub/Sub
++++
-Use the `google-pubsub` input to read messages from a Google Cloud Pub/Sub topic
+Use the `gcp-pubsub` input to read messages from a Google Cloud Pub/Sub topic
subscription.
This input can, for example, be used to receive Stackdriver logs that have been
@@ -23,7 +23,7 @@ Example configuration:
["source","yaml",subs="attributes"]
----
{beatname_lc}.inputs:
-- type: google-pubsub
+- type: gcp-pubsub
project_id: my-gcp-project-id
topic: vpc-firewall-logs-topic
subscription.name: filebeat-vpc-firewall-logs-sub
@@ -33,7 +33,7 @@ Example configuration:
==== Configuration options
-The `google-pubsub` input supports the following configuration options plus the
+The `gcp-pubsub` input supports the following configuration options plus the
<<{beatname_lc}-input-{type}-common-options>> described later.
[float]
diff --git a/x-pack/filebeat/filebeat.reference.yml b/x-pack/filebeat/filebeat.reference.yml
index 4da3150c30a..869950487a3 100644
--- a/x-pack/filebeat/filebeat.reference.yml
+++ b/x-pack/filebeat/filebeat.reference.yml
@@ -2388,7 +2388,7 @@ filebeat.inputs:
#---------------------------- Google Cloud Pub/Sub Input -----------------------
# Input for reading messages from a Google Cloud Pub/Sub topic subscription.
-- type: google-pubsub
+- type: gcp-pubsub
enabled: false
# Google Cloud project ID. Required.
diff --git a/x-pack/filebeat/include/list.go b/x-pack/filebeat/include/list.go
index fe3dd04ad7d..292b9eaf004 100644
--- a/x-pack/filebeat/include/list.go
+++ b/x-pack/filebeat/include/list.go
@@ -10,7 +10,7 @@ import (
// Import packages that need to register themselves.
_ "github.com/elastic/beats/v7/x-pack/filebeat/input/awscloudwatch"
_ "github.com/elastic/beats/v7/x-pack/filebeat/input/azureeventhub"
- _ "github.com/elastic/beats/v7/x-pack/filebeat/input/googlepubsub"
+ _ "github.com/elastic/beats/v7/x-pack/filebeat/input/gcppubsub"
_ "github.com/elastic/beats/v7/x-pack/filebeat/input/netflow"
_ "github.com/elastic/beats/v7/x-pack/filebeat/input/s3"
_ "github.com/elastic/beats/v7/x-pack/filebeat/module/activemq"
diff --git a/x-pack/filebeat/input/googlepubsub/_meta/Dockerfile b/x-pack/filebeat/input/gcppubsub/_meta/Dockerfile
similarity index 100%
rename from x-pack/filebeat/input/googlepubsub/_meta/Dockerfile
rename to x-pack/filebeat/input/gcppubsub/_meta/Dockerfile
diff --git a/x-pack/filebeat/input/googlepubsub/_meta/supported-versions.yml b/x-pack/filebeat/input/gcppubsub/_meta/supported-versions.yml
similarity index 100%
rename from x-pack/filebeat/input/googlepubsub/_meta/supported-versions.yml
rename to x-pack/filebeat/input/gcppubsub/_meta/supported-versions.yml
diff --git a/x-pack/filebeat/input/googlepubsub/config.go b/x-pack/filebeat/input/gcppubsub/config.go
similarity index 91%
rename from x-pack/filebeat/input/googlepubsub/config.go
rename to x-pack/filebeat/input/gcppubsub/config.go
index 56f02f3a471..fdb4c30dfee 100644
--- a/x-pack/filebeat/input/googlepubsub/config.go
+++ b/x-pack/filebeat/input/gcppubsub/config.go
@@ -2,18 +2,21 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
-package googlepubsub
+package gcppubsub
import (
"context"
"fmt"
"os"
+ "github.com/elastic/beats/v7/filebeat/harvester"
+
"cloud.google.com/go/pubsub"
"golang.org/x/oauth2/google"
)
type config struct {
+ harvester.ForwarderConfig `config:",inline"`
// Google Cloud project name.
ProjectID string `config:"project_id" validate:"required"`
@@ -62,6 +65,9 @@ func (c *config) Validate() error {
func defaultConfig() config {
var c config
+ c.ForwarderConfig = harvester.ForwarderConfig{
+ Type: "gcp-pubsub",
+ }
c.Subscription.NumGoroutines = 1
c.Subscription.MaxOutstandingMessages = 1000
c.Subscription.Create = true
diff --git a/x-pack/filebeat/input/googlepubsub/config_test.go b/x-pack/filebeat/input/gcppubsub/config_test.go
similarity index 98%
rename from x-pack/filebeat/input/googlepubsub/config_test.go
rename to x-pack/filebeat/input/gcppubsub/config_test.go
index 6e949326ca3..9897867507c 100644
--- a/x-pack/filebeat/input/googlepubsub/config_test.go
+++ b/x-pack/filebeat/input/gcppubsub/config_test.go
@@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
-package googlepubsub
+package gcppubsub
import (
"os"
diff --git a/x-pack/filebeat/input/googlepubsub/docker-compose.yml b/x-pack/filebeat/input/gcppubsub/docker-compose.yml
similarity index 100%
rename from x-pack/filebeat/input/googlepubsub/docker-compose.yml
rename to x-pack/filebeat/input/gcppubsub/docker-compose.yml
diff --git a/x-pack/filebeat/input/googlepubsub/input.go b/x-pack/filebeat/input/gcppubsub/input.go
similarity index 91%
rename from x-pack/filebeat/input/googlepubsub/input.go
rename to x-pack/filebeat/input/gcppubsub/input.go
index a9e1b9f7873..69e8bb64cc2 100644
--- a/x-pack/filebeat/input/googlepubsub/input.go
+++ b/x-pack/filebeat/input/gcppubsub/input.go
@@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
-package googlepubsub
+package gcppubsub
import (
"context"
@@ -26,7 +26,8 @@ import (
)
const (
- inputName = "google-pubsub"
+ inputName = "gcp-pubsub"
+ oldInputName = "google-pubsub"
)
func init() {
@@ -34,6 +35,11 @@ func init() {
if err != nil {
panic(errors.Wrapf(err, "failed to register %v input", inputName))
}
+
+ err = input.Register(oldInputName, NewInput)
+ if err != nil {
+ panic(errors.Wrapf(err, "failed to register %v input", oldInputName))
+ }
}
type pubsubInput struct {
@@ -64,6 +70,15 @@ func NewInput(
return nil, err
}
+ logger := logp.NewLogger("gcp.pubsub").With(
+ "pubsub_project", conf.ProjectID,
+ "pubsub_topic", conf.Topic,
+ "pubsub_subscription", conf.Subscription)
+
+ if conf.Type == oldInputName {
+ logger.Warnf("%s input name is deprecated, please use %s instead", oldInputName, inputName)
+ }
+
// Wrap input.Context's Done channel with a context.Context. This goroutine
// stops with the parent closes the Done channel.
inputCtx, cancelInputCtx := context.WithCancel(context.Background())
@@ -80,11 +95,8 @@ func NewInput(
workerCtx, workerCancel := context.WithCancel(inputCtx)
in := &pubsubInput{
- config: conf,
- log: logp.NewLogger("google.pubsub").With(
- "pubsub_project", conf.ProjectID,
- "pubsub_topic", conf.Topic,
- "pubsub_subscription", conf.Subscription),
+ config: conf,
+ log: logger,
inputCtx: inputCtx,
workerCtx: workerCtx,
workerCancel: workerCancel,
@@ -109,7 +121,7 @@ func NewInput(
if err != nil {
return nil, err
}
- in.log.Info("Initialized Google Pub/Sub input.")
+ in.log.Info("Initialized GCP Pub/Sub input.")
return in, nil
}
diff --git a/x-pack/filebeat/input/googlepubsub/pubsub_test.go b/x-pack/filebeat/input/gcppubsub/pubsub_test.go
similarity index 99%
rename from x-pack/filebeat/input/googlepubsub/pubsub_test.go
rename to x-pack/filebeat/input/gcppubsub/pubsub_test.go
index caf4e82e698..216bd3cb0b0 100644
--- a/x-pack/filebeat/input/googlepubsub/pubsub_test.go
+++ b/x-pack/filebeat/input/gcppubsub/pubsub_test.go
@@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
-package googlepubsub
+package gcppubsub
import (
"context"
diff --git a/x-pack/filebeat/input/googlepubsub/testdata/fake.json b/x-pack/filebeat/input/gcppubsub/testdata/fake.json
similarity index 100%
rename from x-pack/filebeat/input/googlepubsub/testdata/fake.json
rename to x-pack/filebeat/input/gcppubsub/testdata/fake.json
diff --git a/x-pack/filebeat/module/googlecloud/audit/config/input.yml b/x-pack/filebeat/module/googlecloud/audit/config/input.yml
index b5e392ee0b6..f1c71d4b84f 100644
--- a/x-pack/filebeat/module/googlecloud/audit/config/input.yml
+++ b/x-pack/filebeat/module/googlecloud/audit/config/input.yml
@@ -1,6 +1,6 @@
-{{ if eq .input "google-pubsub" }}
+{{ if eq .input "gcp-pubsub" }}
-type: google-pubsub
+type: gcp-pubsub
project_id: {{ .project_id }}
topic: {{ .topic }}
subscription.name: {{ .subscription_name }}
diff --git a/x-pack/filebeat/module/googlecloud/audit/manifest.yml b/x-pack/filebeat/module/googlecloud/audit/manifest.yml
index cacba81ad71..42b5c4880d6 100644
--- a/x-pack/filebeat/module/googlecloud/audit/manifest.yml
+++ b/x-pack/filebeat/module/googlecloud/audit/manifest.yml
@@ -2,7 +2,7 @@ module_version: "1.0"
var:
- name: input
- default: google-pubsub
+ default: gcp-pubsub
- name: project_id
default: SET_PROJECT_NAME
- name: topic
diff --git a/x-pack/filebeat/module/googlecloud/firewall/config/input.yml b/x-pack/filebeat/module/googlecloud/firewall/config/input.yml
index 39648636c59..1ddda931c49 100644
--- a/x-pack/filebeat/module/googlecloud/firewall/config/input.yml
+++ b/x-pack/filebeat/module/googlecloud/firewall/config/input.yml
@@ -1,6 +1,6 @@
-{{ if eq .input "google-pubsub" }}
+{{ if eq .input "gcp-pubsub" }}
-type: google-pubsub
+type: gcp-pubsub
project_id: {{ .project_id }}
topic: {{ .topic }}
subscription.name: {{ .subscription_name }}
diff --git a/x-pack/filebeat/module/googlecloud/firewall/manifest.yml b/x-pack/filebeat/module/googlecloud/firewall/manifest.yml
index 6563173197f..009ace59c23 100644
--- a/x-pack/filebeat/module/googlecloud/firewall/manifest.yml
+++ b/x-pack/filebeat/module/googlecloud/firewall/manifest.yml
@@ -2,7 +2,7 @@ module_version: "1.0"
var:
- name: input
- default: google-pubsub
+ default: gcp-pubsub
- name: project_id
default: SET_PROJECT_NAME
- name: topic
diff --git a/x-pack/filebeat/module/googlecloud/vpcflow/config/input.yml b/x-pack/filebeat/module/googlecloud/vpcflow/config/input.yml
index f1976195687..2854b8ed332 100644
--- a/x-pack/filebeat/module/googlecloud/vpcflow/config/input.yml
+++ b/x-pack/filebeat/module/googlecloud/vpcflow/config/input.yml
@@ -1,6 +1,6 @@
-{{ if eq .input "google-pubsub" }}
+{{ if eq .input "gcp-pubsub" }}
-type: google-pubsub
+type: gcp-pubsub
project_id: {{ .project_id }}
topic: {{ .topic }}
subscription.name: {{ .subscription_name }}