Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Demo-Spring-Fluentd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Read Me First

1. Setup elasticsearch-fluentd-kibana environment:
- `cd efk`
- `docker-compose up`

2. Run sping-boot example code, at project folder
- `mvn spring-boot:run`

3. Open browser and access to `http://localhost:8080/test/fluentd-log`

4. Open kibana: `http://localhost:5602`
- switch to "Discover"
- then setup index to browser

Try and update TestController to
7 changes: 7 additions & 0 deletions Demo-Spring-Fluentd/efk/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# fluentd/Dockerfile
FROM fluent/fluentd:v1.11-1
USER root
RUN ["gem", "install", "fluent-plugin-elasticsearch", "--no-document", "--version", "4.1.2"]
RUN ["gem", "install", "fluent-plugin-rewrite-tag-filter"]
RUN ["gem", "install", "fluent-plugin-record-modifier", "--no-document"]
USER fluent
25 changes: 25 additions & 0 deletions Demo-Spring-Fluentd/efk/conf/fluent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<source>
@type forward
port 20001
bind 0.0.0.0
add_tag_prefix forward
</source>

<match forward.**>
@type copy
<store>
@type elasticsearch
host elasticsearch
port 9200
logstash_format true
logstash_prefix fluentd
logstash_dateformat %Y%m%d
include_tag_key true
type_name web_log
tag_key @log_name
flush_interval 1s
</store>
<store>
@type stdout
</store>
</match>
24 changes: 24 additions & 0 deletions Demo-Spring-Fluentd/efk/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3'
services:
fluentd:
build: .
volumes:
- ./conf:/fluentd/etc
links:
- "elasticsearch"
ports:
- "20001:20001"

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.1
environment:
- "discovery.type=single-node"
expose:
- "9200"

kibana:
image: docker.elastic.co/kibana/kibana-oss:7.9.1
links:
- "elasticsearch"
ports:
- "5602:5601"
310 changes: 310 additions & 0 deletions Demo-Spring-Fluentd/mvnw

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading