# Exporting GCP stackdriver log to elasticsearch on premise

**URL:** <https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343>\
**Category:** Elasticsearch\
**Created:** [May 18, 2021, 8:09pm UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343 "2021-05-18T20:09:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![soufiane\_adn](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@soufiane\_adn](https://discuss.elastic.co/u/soufiane_adn)\
**Post date:** [May 18, 2021, 8:09pm UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343/1 "2021-05-18T20:09:15Z")

</div>

Hello team,  
can we export logs from google cloud GCP (stackdriver) to an elasticsearch on premise?  
I found the link below, but they assume that elasticsearch is established on elastic cloud, on my case I have a local cluster so there is no cloud. Id and cloud. Auth

> **[Scenarios for exporting Cloud Logging: Elasticsearch](https://cloud.google.com/architecture/exporting-stackdriver-logging-elasticsearch)**

I don't know if it's possible to ensure this integration with a local elasticsearch , if it's possible so how?  
thanks in the advance

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 18, 2021, 8:28pm UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343/2 "2021-05-18T20:28:38Z")

</div>

Where is your "Local Elastic Search Cluster" where in GCP, On Prem ... it is just a matter of network connectivity. Filebeat just needs to be able to reach Elasticsearch whether you manage it or it is on Elastic Cloud.

Instead of `cloud.id` and `cloud.auth` you will just use the normal Elasticsearch URL, username and password found [here](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html)

eg.

```
output.elasticsearch:
  hosts: ["https://myEShost:9200"]
  username: "filebeat_writer"
  password: "YOUR_PASSWORD"
```

---

<div class="post-metadata">

**Author:** ![Sdaoudi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sdaoudi/32/88932_2.png) [@Sdaoudi](https://discuss.elastic.co/u/Sdaoudi)\
**Post date:** [May 18, 2021, 9:13pm UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343/3 "2021-05-18T21:13:02Z")

</div>

Hello,

I have the same case 😢 I am on the first part and i want to know how to transfer events from gcp stackdriver to a filebeat instance located on the my gcp cloud.

Thanks advance

---

<div class="post-metadata">

**Author:** ![soufiane\_adn](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@soufiane\_adn](https://discuss.elastic.co/u/soufiane_adn)\
**Post date:** [May 18, 2021, 9:53pm UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343/4 "2021-05-18T21:53:54Z")

</div>

hello stephen,  
thanks for your answer.  
normally i have the elasticsearch cluster outside the GCP, installed on a physical servers. but i can create a filebeat instance if it's needed.  
so if i understand i don't need the cloud id and cloud.auth to export logs to my on premise elasticsearch?  
they can be replaced by the http or https link to elasticsearch

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 19, 2021, 12:58am UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343/5 "2021-05-19T00:58:43Z")

</div>

The [GCP article referenc](https://cloud.google.com/architecture/exporting-stackdriver-logging-elasticsearch)e in the first post above does a very good job of step by step the only thing you need to do different Just use the full `output.elasticsearch:` as I showed, please look at the reference documentation.

You will need to use the gcp input in filebeat see the docs here :

> **[GCP Pub/Sub input | Filebeat Reference \[7.12\] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-gcp-pubsub.html)**

There will need to be network connectivity.

---

<div class="post-metadata">

**Author:** ![soufiane\_adn](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@soufiane\_adn](https://discuss.elastic.co/u/soufiane_adn)\
**Post date:** [May 19, 2021, 7:45am UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343/6 "2021-05-19T07:45:29Z")

</div>

Thank youu,  
i will try & revert.

---

<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:** [June 16, 2021, 7:45am UTC](https://discuss.elastic.co/t/exporting-gcp-stackdriver-log-to-elasticsearch-on-premise/273343/7 "2021-06-16T07:45:58Z")

</div>

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