Skip to content

Latest commit

 

History

History
51 lines (30 loc) · 1.38 KB

Readme.md

File metadata and controls

51 lines (30 loc) · 1.38 KB

Spring Boot Sleuth Splunk demo Build Status

Sample project to show log forwarding from a Spring Boot application to Splunk via a file forwarder.

Sleuth is also added to generate IDs for each request

Build

Build the application as a Docker image using:

mvn clean package

Run

Run the included docker-compose file with:

docker-compose up

This will bring up three containers: A demo application, Splunk, and a Spunk Forwarder.

Logs are forwarded to Splunk via a shared volume between the application and forwarder.

It is possible to send logs to Splunk via Docker's logging mechanism, but the goal here was to use the file forwarder to replicate a production setup.

Generate logs

Application startup will generate some logs.

Calling the demo endpoint will generate some more logs, with Sleuth trace and Span Ids.

curl http://localhost:8080?name=test

View Logs

Got to Splunk login to view the logs.

Login is admin/password

Stop

Stop the containers and remove unused volumes with:

docker-compose down -v