Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Labs

Install and Configure Logging Agent on Google Cloud

This lab guides you through installing the Cloud Logging agent on a Compute Engine instance, acting as an Apache web server. We install and configure the agent on the web server instance, and view application-specific logs collected.

Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 45m
Published
Clock icon Dec 04, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Install and Configure Logging Agent on Website Instance

    1. Once on the Google Cloud Platform page, select Compute Engine >>VM Instances and click on the External IP and keep this tab open.

    2. In a new browser tab, we note the logs available by clicking on the top-left three bar-menu, and select Logging >> Log Explorer(open in new tab).

    3. Click VM Instance and note the logs under the Log Name portion.

    4. Connect to the Compute Engine, by going back to the Compute Engine browser tab. Select SSH to enter into the Compute Engine instance. This launches a new browser tab with access to a Cloud terminal.

    5. Once in the Compute Engine terminal, install the agent:

      curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh
      
    6. Execute the script:

      sudo bash add-logging-agent-repo.sh
      
    7. Update our repo:

      sudo apt update
      
    8. Install the logging agent:

      sudo apt install google-fluentd
      
    9. Install additional configurations:

      sudo apt install -y google-fluentd-catch-all-config
      
    10. Restart the agent:

      sudo service google-fluentd restart
      
    11. Ensure the agent is running:

      sudo service google-fluentd status
      

      If running, this output will contain: Active: active (running).

    12. Exit out of the SSH terminal with:

      exit
      
  2. Challenge

    Generate Traffic to Our Example Website

    1. Generate traffic/logs to our example website by navigating back to this Compute Engine's browser tab. Refresh the page multiple times (5-10 times).
  3. Challenge

    View Apache-Access and Linux Syslog Logs in Logs Viewer

    1. Navigate back to the Log Explorer browser tab and refresh this page.
    2. Click Options >> Go back to the Legacy Logs Viewer.
    3. Select Legacy Log Viewer. In the first dropdown menu (Audited Resources), select VM Instance >>web-agent-server.
    4. The All logs drop-down menu shows new log entries that are specific to our Compute Engine (apache-access, apache-error, syslog).

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans