Instructions
Instructions
Overview
This document provides instructions on how to use the provided Bash script to retrieve logs from
Google Cloud Logging and store them in a CSV file. The script requires a Google Cloud project
ID, a service account key file, and a bucket name. It authenticates with Google Cloud, sets the
project, and retrieves logs based on specified filters.
Prerequisites
● You need to have the Google Cloud SDK installed on your machine.
● Ensure you have permissions to access the Google Cloud project and the logging
service.
● A service account key file (in JSON format) should be created and downloaded from the
Google Cloud Console.
Script Breakdown
Script Code
#!/bin/bash
# Set project ID, key file, and bucket from script arguments
PROJECT_ID=$1
KEY_FILE=$2
BUCKET=$3
○ Replace <PROJECT_ID> with your Google Cloud project ID, <KEY_FILE> with
the path to your service account key file, and <BUCKET> with your log sink bucket
name.