Skip to content

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

License

Notifications You must be signed in to change notification settings

barrycommins/spring-boot-splunk-sleuth-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages