Log Observer

10 minutes  

Up until this point, there have been no code changes, yet tracing, profiling and Database Query Performance data is being sent to Splunk Observability Cloud.

Next, we will work with Splunk Log Observer to obtain log data from the Spring PetClinic application.

The Splunk OpenTelemetry Collector automatically collects logs from the Spring PetClinic application and sends them to Splunk Observability Cloud using the OTLP exporter, annotating the log events with trace_id, span_id and trace flags.

Splunk Log Observer is then used to view the logs, automatically correlating log information with services and traces.

This feature is called Related Content.

Last Modified Mar 21, 2025

Subsections of 7. Log Observer

Viewing the Logs

In order to see logs click on the Logo Logo Log Observer in the left-hand menu. Once in Log Observer please ensure Index on the filter bar is set to splunk4rookies-workshop. (1)

Next, click Add Filter and search, using the Fields (2) option for the field deployment.environment (3). Then from the dropdown list, select your workshop instance, (4) and click = (to include). You will now see only the log messages from your PetClinic application.

Log Observer sort Log Observer sort

Next, search for the field service.name, selecting the value customers-service and click = (to include). This should now appear in the filter bar (1). Next click on the Button Run Search (2).

Log Observer run Log Observer run

This wil refresh the log entries and they will now be reduced to show the entries from your customers-service only.

Log Observer Log Observer

Click on an entry that starts with “Saving pet” (1). A side pane will open where you can see the detailed information, including the relevant trace and span IDs (2).

Last Modified Mar 21, 2025

Related Content

The bottom pane is where any related content will be reported. In the screenshot below you can see that APM has found a trace that is related to this log line (1):

RC RC

By clicking (2) on Trace for 960432ac9f16b98be84618778905af50 we will be taken to the waterfall in APM for this specific trace, where this log line was generated:

waterfall logs waterfall logs

Note that you now have a Related Content pane for Logs appearing (1). Clicking on this will take you back to Log Observer and will display all the log lines that are part of this trace.