Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/barrycommins/spring-boot-splunk-sleuth-demo
Sample project to show log forwarding from a Spring Boot application to Splunk via a file forwarder.
https://github.com/barrycommins/spring-boot-splunk-sleuth-demo
sleuth splunk spring-boot
Last synced: 3 months ago
JSON representation
Sample project to show log forwarding from a Spring Boot application to Splunk via a file forwarder.
- Host: GitHub
- URL: https://github.com/barrycommins/spring-boot-splunk-sleuth-demo
- Owner: barrycommins
- License: mit
- Created: 2017-05-29T22:08:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T03:56:38.000Z (over 1 year ago)
- Last Synced: 2024-06-18T11:35:16.516Z (5 months ago)
- Topics: sleuth, splunk, spring-boot
- Language: Java
- Size: 30.3 KB
- Stars: 17
- Watchers: 3
- Forks: 13
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Spring Boot Sleuth Splunk demo [![Build Status](https://travis-ci.com/barrycommins/spring-boot-splunk-sleuth-demo.svg?branch=master)](https://travis-ci.com/barrycommins/spring-boot-splunk-sleuth-demo)
Sample project to show log forwarding from a [Spring Boot](https://projects.spring.io/spring-boot/) application to [Splunk](https://www.splunk.com/) via a file forwarder.[Sleuth](https://cloud.spring.io/spring-cloud-sleuth/) is also added to generate IDs for each request
## Build
Build the application as a [Docker](https://www.docker.com/) image using:
```bash
mvn clean package
```## Run
Run the included docker-compose file with:
```bash
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.
```bash
curl http://localhost:8080?name=test
```## View Logs
Got to [Splunk login](http://localhost:8000) to view the logs.
Login is admin/password
## Stop
Stop the containers and remove unused volumes with:
```bash
docker-compose down -v
```