Forwarding Google Cloud Logging to Own Cloud Service

TLDR Florian sought help forwarding Google Cloud logging to their cloud service. Prabhat suggested exporting logs via pub-sub to OpenObserve, with authentication needing improvement. After considering alternatives, they agreed to use a URL with a shared key.

Photo of Florian
Florian
Fri, 16 Jun 2023 12:21:51 UTC

Hi, do you have an idea how to forward google cloud logging to your cloud service? (I think the same process would work with OSS as well)

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:22:38 UTC

the recommended mechanism on GCP for exporting logs is via pub sub

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:23:00 UTC

logs -> log router -> pub-sub-> OpenObserve

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:23:22 UTC

there one missing item on authentication at OpenObserve for google cloud

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:24:13 UTC

pub-sub sends a JWT that needs to be validated by OpenObserve to amke sure that the request is coming from the expected source

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:24:35 UTC

We will need to build this on OpenObserve cloud as well as open source.

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:24:52 UTC

We have done something similar for AWS using kinesis firehose.

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:26:25 UTC

I am trying to find the keys that can be used for validating the JWT from GCP docs

Photo of Florian
Florian
Fri, 16 Jun 2023 12:28:57 UTC

No worries I am not in a hurry. Looking at DD they worked around this by using a URL located API key

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:29:30 UTC

Ah, neat trick. a shared key.

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:29:34 UTC

that could work too

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:30:15 UTC

I would rather prefer the JWT as its more secure than the shared secret but let's figure out the complexity

Photo of Florian
Florian
Fri, 16 Jun 2023 12:30:29 UTC

Yeah, the google way is rather complex but also more secure :smile:

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:55:34 UTC

I checked. We will take the easy path

Photo of Prabhat
Prabhat
Fri, 16 Jun 2023 12:55:49 UTC

give a URL with the shared key

Photo of Florian
Florian
Fri, 16 Jun 2023 13:34:19 UTC

Perfect, I will happily try it :smile: