# Trying to use logstash-input-google\_pubsub

**URL:** <https://discuss.elastic.co/t/trying-to-use-logstash-input-google-pubsub/80469>\
**Category:** Logstash\
**Created:** [March 29, 2017, 11:22am UTC](https://discuss.elastic.co/t/trying-to-use-logstash-input-google-pubsub/80469 "2017-03-29T11:22:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinaWork](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dinaWork](https://discuss.elastic.co/u/dinaWork)\
**Post date:** [March 29, 2017, 11:22am UTC](https://discuss.elastic.co/t/trying-to-use-logstash-input-google-pubsub/80469/1 "2017-03-29T11:22:30Z")

</div>

here is conf/logstash.conf

```auto
input {
    google_pubsub {
        project_id => "myProjectId"
        topic => "logstash-input-dev"
        subscription => "logstash-sub"
        json_key_file => "/usr/share/logstash/key-file.json"
    }
}

output {	
  stdout {}
}

```

here is my logstash.yaml

```auto
path.config: /usr/share/logstash/pipeline

config.reload.automatic: true

config.debug: false

```

running:

```auto
docker run --rm -it -v /key-file.json:/usr/share/logstash/key-file.json -v ~/conf/:/usr/share/logstash/pipeline/ -v ~/logstash.yml:/usr/share/logstash/config/logstash.yml sphereio/logstash-input-google_pubsub

```

here is my output

```auto

Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties

10:38:26.430 [main] INFO logstash.setting.writabledirectory - Creating directory {:setting=>"path.queue", :path=>"/usr/share/logstash/data/queue"}
10:38:26.496 [LogStash::Runner] INFO logstash.agent - No persistent UUID file found. Generating new UUID {:uuid=>"dc6bcc6a-dd8c-49c9-a15c-cb4a745713ff", :path=>"/var/lib/logstash/uuid"}
The stdin plugin is now waiting for input:
10:38:27.366 [[main]-pipeline-manager] INFO logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>500}
10:38:27.457 [[main]-pipeline-manager] INFO logstash.pipeline - Pipeline main started
10:38:27.760 [Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=>9600}
{
    "@timestamp" => 2017-03-29T10:38:28.359Z,
      "@version" => "1",
          "host" => "5b087dbebdf5",
       "message" => "",
          "type" => "stdin"
}

```

ok now publishing to pubsub

`gcloud beta pubsub topics publish projects/myProjectId/topics/logstash-input-dev "hello-all"`

nothing is happening, cant see the logs.

trying to pull message myself:  
`gcloud beta pubsub subscriptions pull --auto-ack projects/myProjectId/subscriptions/logstash-sub`

I get it (which means the plugin hasnt pulled the message)

┌──────┬─────────────────┬────────────┐  
│ DATA │ MESSAGE\_ID │ ATTRIBUTES │  
├──────┼─────────────────┼────────────┤  
│ hello-all │ 114103460666990 │ │  
└──────┴─────────────────┴────────────┘

I connected to the docker running- and all seems ok

`docker exec -ti 5b087dbebdf5 bash`

`cat /usr/share/logstash/config/logstash.yml`  
I see my yml is there

`cat /usr/share/logstash/pipeline/logstash.conf`  
the above conf is there

`cat /usr/share/logstash/key-file.json`  
json file is there

how can I track whats wrong here?

---

<div class="post-metadata">

**Author:** ![ZonOrti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zonorti/32/16875_2.png) [@ZonOrti](https://discuss.elastic.co/u/ZonOrti)\
**Post date:** [March 29, 2017, 7:06pm UTC](https://discuss.elastic.co/t/trying-to-use-logstash-input-google-pubsub/80469/2 "2017-03-29T19:06:36Z")

</div>

Hi,

When container starts and connects to Google PubSub successfully you should see something like:

```auto
"07:31:17.791 [[main]<google_pubsub] INFO logstash.inputs.googlepubsub - Pulling messages from sub 'projects/projectID/subscriptions/logstash-sub'

```

This line is not here, and in general, it looks like your config is ignored.  
I've checked my configuration and it looks like [https://hub.docker.com/\_/logstash/](https://hub.docker.com/_/logstash/) image reads config from `/etc/logstash/logstash.yml` and not from `/usr/share/logstash/config/logstash.yml`  
Try to change mount path.  
Hope it helps

---

<div class="post-metadata">

**Author:** ![dinaWork](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dinaWork](https://discuss.elastic.co/u/dinaWork)\
**Post date:** [April 1, 2017, 5:18pm UTC](https://discuss.elastic.co/t/trying-to-use-logstash-input-google-pubsub/80469/3 "2017-04-01T17:18:00Z")

</div>

Thanks! I've changed the mount path now it's working fine!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 29, 2017, 5:18pm UTC](https://discuss.elastic.co/t/trying-to-use-logstash-input-google-pubsub/80469/4 "2017-04-29T17:18:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
