Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Export logs from virtual machine to cloud logging

I have an instance in Google cloud which runs a customized image of Almalinux 8.   Its not an image provided by GCP.  

There is a log file on this instance which I want to export to Google cloud logging.  I have created a service account with "log writer" role for this purpose.    

Please suggest which tool would be best for this purpose and also share any configuration steps if you have.  

Solved Solved
0 4 4,346
1 ACCEPTED SOLUTION

Yep, it should. Ops Agent it's standalone binary, so after installation you should be able to see needed logs. It might be possible that Ops Agent config need's to be changed to collect from provided app file, but basically  should work

View solution in original post

4 REPLIES 4

You can install ops agent to your VM instance to send any application specific logs to cloud logging.

https://cloud.google.com/logging/docs/agent/logging/configuration

this is a custom image so doesn't contain stackdriver, will it still work?

Yep, it should. Ops Agent it's standalone binary, so after installation you should be able to see needed logs. It might be possible that Ops Agent config need's to be changed to collect from provided app file, but basically  should work

Hi 
We are using autoscaling for our servers whenever the server is terminated my logs should move from the server to the s3 bucket. Please let me know the logic of how I can work on this. It is a  debian server