Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
docker-elk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段孔乐
docker-elk
Commits
a9f67726
Commit
a9f67726
authored
May 13, 2021
by
段孔乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify config file
parent
37dc3c1d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
22 deletions
+65
-22
docker-compose.yml
docker-compose.yml
+9
-9
docker-stack.yml
docker-stack.yml
+6
-6
elasticsearch.yml
elasticsearch/config/elasticsearch.yml
+1
-1
logstash.conf
logstash/pipeline/logstash.conf
+49
-6
No files found.
docker-compose.yml
View file @
a9f67726
...
...
@@ -15,10 +15,10 @@ services:
source
:
elasticsearch
target
:
/usr/share/elasticsearch/data
ports
:
-
"
9200:9200"
-
"
9300:9300"
-
"
1
9200:9200"
-
"
1
9300:9300"
environment
:
ES_JAVA_OPTS
:
"
-Xmx
256m
-Xms256
m"
ES_JAVA_OPTS
:
"
-Xmx
512m
-Xms512
m"
ELASTIC_PASSWORD
:
changeme
# Use single node discovery in order to disable production mode and avoid bootstrap checks.
# see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
...
...
@@ -41,12 +41,12 @@ services:
target
:
/usr/share/logstash/pipeline
read_only
:
true
ports
:
-
"
5044:5044"
-
"
5000:5000/tcp"
-
"
5000:5000/udp"
-
"
9600:9600"
-
"
1
5044:5044"
-
"
1
5000:5000/tcp"
-
"
1
5000:5000/udp"
-
"
1
9600:9600"
environment
:
LS_JAVA_OPTS
:
"
-Xmx
256m
-Xms256
m"
LS_JAVA_OPTS
:
"
-Xmx
512m
-Xms512
m"
networks
:
-
elk
depends_on
:
...
...
@@ -63,7 +63,7 @@ services:
target
:
/usr/share/kibana/config/kibana.yml
read_only
:
true
ports
:
-
"
5601:5601"
-
"
1
5601:5601"
networks
:
-
elk
depends_on
:
...
...
docker-stack.yml
View file @
a9f67726
...
...
@@ -5,8 +5,8 @@ services:
elasticsearch
:
image
:
docker.elastic.co/elasticsearch/elasticsearch:7.12.0
ports
:
-
"
9
200:9200"
-
"
9
300:9300"
-
"
15
200:9200"
-
"
15
300:9300"
configs
:
-
source
:
elastic_config
target
:
/usr/share/elasticsearch/config/elasticsearch.yml
...
...
@@ -27,9 +27,9 @@ services:
logstash
:
image
:
docker.elastic.co/logstash/logstash:7.12.0
ports
:
-
"
5044:5044"
-
"
5000:5000"
-
"
9
600:9600"
-
"
1
5044:5044"
-
"
1
5000:5000"
-
"
15
600:9600"
configs
:
-
source
:
logstash_config
target
:
/usr/share/logstash/config/logstash.yml
...
...
@@ -46,7 +46,7 @@ services:
kibana
:
image
:
docker.elastic.co/kibana/kibana:7.12.0
ports
:
-
"
5601:5601"
-
"
1
5601:5601"
configs
:
-
source
:
kibana_config
target
:
/usr/share/kibana/config/kibana.yml
...
...
elasticsearch/config/elasticsearch.yml
View file @
a9f67726
...
...
@@ -9,5 +9,5 @@ network.host: 0.0.0.0
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack.html
#
xpack.license.self_generated.type
:
trial
xpack.security.enabled
:
tru
e
xpack.security.enabled
:
fals
e
xpack.monitoring.collection.enabled
:
true
logstash/pipeline/logstash.conf
View file @
a9f67726
...
...
@@ -10,11 +10,54 @@ input {
## Add your filters / logstash plugins configuration here
output
{
elasticsearch
{
hosts
=>
"elasticsearch:9200"
user
=>
"elastic"
password
=>
"changeme"
ecs_compatibility
=>
disabled
filter
{
if
(
"stat.log"
in
[
log
][
file
][
path
]) {
drop
{}
}
mutate
{
add_field
=> {
"input-type"
=>
"%{[agent][type]}-%{[input][type]}"
}
remove_field
=> [
"agent"
,
"ecs"
,
"tags"
,
"input"
,
"host"
]
}
json
{
source
=>
"message"
skip_on_invalid_json
=>
true
target
=>
"json"
}
if
"gateway"
in
[
log
][
file
][
path
]{
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"gateway-service-%{+YYYY.MM}"
} }
}
else
if
"swagger"
in
[
log
][
file
][
path
]{
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"swagger-service-%{+YYYY.MM}"
} }
}
else
if
"auth-service"
in
[
log
][
file
][
path
] {
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"auth-service-%{+YYYY.MM}"
} }
}
else
if
"file-service"
in
[
log
][
file
][
path
] {
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"file-service-%{+YYYY.MM}"
} }
}
else
if
"notify-service"
in
[
log
][
file
][
path
] {
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"notify-service-%{+YYYY.MM}"
} }
}
else
if
"pay-service"
in
[
log
][
file
][
path
] {
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"pay-service-%{+YYYY.MM}"
} }
}
else
if
"proof-service"
in
[
log
][
file
][
path
] {
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"proof-service-%{+YYYY.MM}"
} }
}
else
if
"tx-service"
in
[
log
][
file
][
path
] {
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"tx-service-%{+YYYY.MM}"
} }
}
else
if
"user-service"
in
[
log
][
file
][
path
] {
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"user-service-%{+YYYY.MM}"
} }
}
else
{
mutate
{
add_field
=> {
"[@metadata][target_index]"
=>
"others-%{+YYYY.MM}"
} }
}
}
output
{
elasticsearch
{
index
=>
"%{[@metadata][target_index]}"
hosts
=> [
"elasticsearch:9200"
]
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment