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
cf53da7e
Commit
cf53da7e
authored
Jul 02, 2021
by
段孔乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add install script
parent
63fe3b1d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
28 deletions
+44
-28
ELK部署文档.md
ELK部署文档.md
+4
-1
init-kibana.sh
init-kibana.sh
+39
-27
start.sh
start.sh
+1
-0
No files found.
ELK部署文档.md
View file @
cf53da7e
# Ela
stic stack (ELK) 部署说明
# Ela
stic stack (ELK) 部署说明
...
...
@@ -25,6 +25,9 @@ Filebeat 负责数据采集
bash start.sh
###配置kibana
bash init-kibana.sh
### Filebeat 部署
项目地址: https://gitlab.33.cn/dkl/filebeat
...
...
init-kibana.sh
View file @
cf53da7e
kibana_host
=
"12
4.71.144.118
:15601"
kibana_host
=
"12
7.0.0.1
:15601"
es_host
=
"127.0.0.1:19200"
function
setDefaultIndex
(){
curl
--location
--request
POST
'http://124.71.144.118:15601/api/kibana/settings'
\
curl
--location
--request
POST
"http://
$kibana_host
/api/kibana/settings"
\
--header
'kbn-version: 7.12.0'
\
--header
'Content-Type: application/json'
\
--data-raw
"{
\"
changes
\"
:{
\"
defaultIndex
\"
:
\"
$1
\"
}}"
}
function
addTestData
()
{
curl
--location
--request
POST
"http://
$es_host
/
$1
/_doc/testdata"
\
--header
'Content-Type: application/json'
\
--data-raw
'{
"message": test data
}'
}
function
addIndexPattern
(){
serviceName
=
"
${
1
}
"
index
=
"
${
serviceName
#\*
}
"
index
=
"
${
index
%\*
}
"
addTestData
"
$index
"
resp
=
$(
curl
-XPOST
"http://
$kibana_host
/api/saved_objects/index-pattern"
\
--header
'kbn-version: 7.12.0'
\
--header
'Content-Type: application/json'
\
...
...
@@ -26,27 +41,24 @@ return "$id"
}
defaultID=addIndexPattern "
*-service*
"
setDefaultIndex "
$defaultID
"
addIndexPattern "
*-service-v1*
"
addIndexPattern "
*-service-v2*
"
addIndexPattern "
auth
-service-v1*
"
addIndexPattern "
department
-service-v2*
"
addIndexPattern "
file
-service-v1*
"
addIndexPattern "
gateway
-service-v1*
"
addIndexPattern "
gateway
-service-v2*
"
addIndexPattern "
metricbeat
-*
"
addIndexPattern "
notify
-service-v1*
"
addIndexPattern "
others
*
"
addIndexPattern "
pay
-service-v1*
"
addIndexPattern "
process
-service-v2*
"
addIndexPattern "
proof
-service-v1*
"
addIndexPattern "
role
-service*
"
addIndexPattern "
role
-service-v2*
"
addIndexPattern "
swagger
-service-v1*
"
addIndexPattern "
swagger
-service-v2*
"
addIndexPattern "
template
-service-v2*
"
addIndexPattern "
trace
-service-v2*
"
addIndexPattern "
tx
-service-v1*
"
addIndexPattern "
user
-service-v1*
"
id=addIndexPattern "
*-service*
"
setDefaultIndex "
$id
"
id=addIndexPattern "
*-service-v1*
"
id=addIndexPattern "
*-service-v2*
"
id=addIndexPattern "
auth
-service-v1*
"
id=addIndexPattern "
department
-service-v2*
"
id=addIndexPattern "
file
-service-v1*
"
id=addIndexPattern "
gateway
-service-v1*
"
id=addIndexPattern "
gateway
-service-v2*
"
id=addIndexPattern "
notify
-service-v1*
"
id=addIndexPattern "
others
*
"
id=addIndexPattern "
pay
-service-v1*
"
id=addIndexPattern "
process
-service-v2*
"
id=addIndexPattern "
proof
-service-v1*
"
id=addIndexPattern "
role
-service-v2*
"
id=addIndexPattern "
swagger
-service-v1*
"
id=addIndexPattern "
swagger
-service-v2*
"
id=addIndexPattern "
template
-service-v2*
"
id=addIndexPattern "
trace
-service-v2*
"
id=addIndexPattern "
tx
-service-v1*
"
id=addIndexPattern "
user
-service-v1*
"
start.sh
View file @
cf53da7e
...
...
@@ -43,6 +43,7 @@ function checkPS(){
if
[
"
$(
docker ps |
grep
-c
'docker-elk'
)
"
-gt
0
]
;
then
red
"======================="
red
"ELK are already started"
red
"======================="
exit
fi
...
...
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