{"id":14110136,"url":"https://github.com/logstash-plugins/logstash-input-google_pubsub","last_synced_at":"2026-02-21T06:38:11.475Z","repository":{"id":45582059,"uuid":"72584140","full_name":"logstash-plugins/logstash-input-google_pubsub","owner":"logstash-plugins","description":"Logstash input for pulling events from Google Pub/Sub service","archived":false,"fork":false,"pushed_at":"2026-02-05T06:59:27.000Z","size":180,"stargazers_count":19,"open_issues_count":20,"forks_count":31,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-02-05T09:46:14.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logstash-plugins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.TXT","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-11-01T23:02:11.000Z","updated_at":"2026-01-31T03:15:38.000Z","dependencies_parsed_at":"2024-01-08T07:56:28.773Z","dependency_job_id":"a25450c6-9033-4600-a30a-419a3aaea326","html_url":"https://github.com/logstash-plugins/logstash-input-google_pubsub","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/logstash-plugins/logstash-input-google_pubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logstash-plugins%2Flogstash-input-google_pubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logstash-plugins%2Flogstash-input-google_pubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logstash-plugins%2Flogstash-input-google_pubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logstash-plugins%2Flogstash-input-google_pubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logstash-plugins","download_url":"https://codeload.github.com/logstash-plugins/logstash-input-google_pubsub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logstash-plugins%2Flogstash-input-google_pubsub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29675506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-14T10:02:40.969Z","updated_at":"2026-02-21T06:38:11.457Z","avatar_url":"https://github.com/logstash-plugins.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Logstash Plugin\n\n[![Travis Build Status](https://travis-ci.com/logstash-plugins/logstash-input-google_pubsub.svg)](https://travis-ci.com/logstash-plugins/logstash-input-google_pubsub)\n\nThis is a [Logstash](https://github.com/elastic/logstash) input plugin for\n[Google Pub/Sub](https://cloud.google.com/pubsub/). The plugin can subscribe\nto a topic and ingest messages.\n\nThe main motivation behind the development of this plugin was to ingest\n[Stackdriver Logging](https://cloud.google.com/logging/) messages via the\n[Exported Logs](https://cloud.google.com/logging/docs/export/using_exported_logs)\nfeature of Stackdriver Logging.\n\nIt is fully free and fully open source. The license is Apache 2.0, meaning you\nare pretty much free to use it however you want in whatever way.\n\n## Documentation\n\n### Prerequisites\n\nYou must first create a Google Cloud Platform project and enable the the\nGoogle Pub/Sub API. If you intend to use the plugin ingest Stackdriver Logging\nmessages, you must also enable the Stackdriver Logging API and configure log\nexporting to Pub/Sub. There is plentiful information on\nhttps://cloud.google.com/ to get started,\n\n- Google Cloud Platform Projects and [Overview](https://cloud.google.com/docs/overview/)\n- Goolge Cloud Pub/Sub [documentation](https://cloud.google.com/pubsub/)\n- Stackdriver Logging [documentation](https://cloud.google.com/logging/)\n\n### Cloud Pub/Sub\n\nCurrently, this module requires you to create a `topic` manually and specify\nit in the logstash config file. You must also specify a `subscription`, but\nthe plugin will attempt to create the pull-based `subscription` on its own.\n\nAll messages received from Pub/Sub will be converted to a logstash `event`\nand added to the processing pipeline queue. All Pub/Sub messages will be\n`acknowledged` and removed from the Pub/Sub `topic` (please see more about\n[Pub/Sub concepts](https://cloud.google.com/pubsub/overview#concepts)).\n\nIt is generally assumed that incoming messages will be in JSON and added to\nthe logstash `event` as-is. However, if a plain text message is received, the\nplugin will return the raw text in as `raw_message` in the logstash `event`.\n\n#### Authentication\n\nYou have two options for authentication depending on where you run Logstash.\n\n1. If you are running Logstash outside of Google Cloud Platform, then you will\nneed to create a Google Cloud Platform Service Account and specify the full\npath to the JSON private key file in your config in `json_key_file` setting.\nIf you don't want to upload the file and use its content as a string, then add the content \nof JSON private key in `json_key_file_content` setting. You must assign sufficient\nroles to the Service Account to create a subscription and to pull messages\nfrom the subscription. Learn more about GCP Service Accounts and IAM roles\nhere:\n\n  - Google Cloud Platform IAM [overview](https://cloud.google.com/iam/)\n  - Creating Service Accounts [overview](https://cloud.google.com/iam/docs/creating-managing-service-accounts)\n  - Granting Roles [overview](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts)\n\n2. If you are running Logstash on a Google Compute Engine instance, you may opt\nto use Application Default Credentials. In this case, you will not need to\nspecify a JSON private key file in your config.\n\n### Stackdriver Logging (optional)\n\nIf you intend to use the logstash plugin for Stackdriver Logging message\ningestion, you must first manually set up the Export option to Coud Pub/Sub and\nthe manually create the `topic`. Please see the more detailed instructions at,\n[Exported Logs](https://cloud.google.com/logging/docs/export/using_exported_logs)\nand ensure that the [necessary permissions](https://cloud.google.com/logging/docs/export/configure_export#manual-access-pubsub)\nhave also been manually configured.\n\nLogging messages from Stackdriver Logging exported to Pub/Sub are received as\nJSON and converted to a logstash `event` as-is in\n[this format](https://cloud.google.com/logging/docs/export/using_exported_logs#log_entries_in_google_pubsub_topics).\n\n### Sample Configuration\n\nBelow is a copy of the included `example.conf-tmpl` file that shows a basic\nconfiguration for this plugin.\n\n```\ninput {\n    google_pubsub {\n        # Your GCP project id (name)\n        project_id =\u003e \"my-project-1234\"\n\n        # The topic name below is currently hard-coded in the plugin. You\n        # must first create this topic by hand and ensure you are exporting\n        # logging to this pubsub topic.\n        topic =\u003e \"logstash-input-dev\"\n\n        # The subscription name is customizeable. The plugin will attempt to\n        # create the subscription (but use the hard-coded topic name above).\n        subscription =\u003e \"logstash-sub\"\n\n        # If you are running logstash within GCE, it will use\n        # Application Default Credentials and use GCE's metadata\n        # service to fetch tokens.  However, if you are running logstash\n        # outside of GCE, you will need to specify the service account's\n        # JSON key file below.\n        #json_key_file =\u003e \"/home/erjohnso/pkey.json\"\n    }\n}\n\noutput { stdout { codec =\u003e rubydebug } }\n```\n\n## (stock) Documentation\n\nLogstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).\n\n- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive\n- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide\n\n## Need Help?\n\nNeed help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.\n\n## Developing\n\n### 1. Plugin Development and Testing\n\n#### Code\n\n- To get started, you'll need JRuby with the Bundler gem installed.\n- You'll also need a Logstash installation to build the plugin against.\n\n- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).\n\n- `export LOGSTASH_SOURCE=1` and point `LOGSTASH_PATH` to a local Logstash\n  e.g. `export LOGSTASH_PATH=/opt/local/logstash-8.7.0`\n\n- Install Ruby dependencies\n```sh\nbundle install\n```\n\n- Install Java dependencies - regenerates the *lib/logstash-input-google_pubsub_jars.rb*\n  script used to load the .jar dependencies when the plugin starts.\n```sh\n./gradlew vendor\n```\n  NOTE: This step is necessary whenever **build.gradle** is updated.\n\n#### Test\n\n- Update your dependencies\n\n```sh\nbundle install\n```\n\n- Run Ruby tests\n\n```sh\nbundle exec rspec\n```\n\n### 2. Running your unpublished Plugin in Logstash\n\n#### 2.1 Run in a local Logstash clone\n\n- Edit Logstash `Gemfile` and add the local plugin path, for example:\n```ruby\ngem \"logstash-filter-awesome\", :path =\u003e \"/your/local/logstash-filter-awesome\"\n```\n- Install plugin\n```sh\nbin/logstash-plugin install --no-verify\n```\n- Run Logstash with your plugin\n```sh\nbin/logstash -e 'filter {awesome {}}'\n```\nAt this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.\n\n#### 2.2 Run in an installed Logstash\n\nYou can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:\n\n- Build your plugin gem\n```sh\ngem build logstash-filter-awesome.gemspec\n```\n- Install the plugin from the Logstash home\n```sh\nbin/logstash-plugin install --no-verify\n```\n- Start Logstash and proceed to test the plugin\n\n## Contributing\n\nAll contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.\n\nProgramming is not a required skill. Whatever you've seen about open source and maintainers or community members  saying \"send patches or die\" - you will not see that here.\n\nIt is more important to the community that you are able to contribute.\n\nFor more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogstash-plugins%2Flogstash-input-google_pubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogstash-plugins%2Flogstash-input-google_pubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogstash-plugins%2Flogstash-input-google_pubsub/lists"}