Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-sb-devops
Commits
35da079d
Commit
35da079d
authored
5 years ago
by
SMY ALTAMASH
Committed by
Keshav Prasad
5 years ago
Browse files
Options
Download
Patches
Plain Diff
Script to get ES data for all the indices in our env (#645)
* Script to add ES data
parent
514db717
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deploy/utilities/getEsData.sh
+20
-0
deploy/utilities/getEsData.sh
with
20 additions
and
0 deletions
+20
-0
deploy/utilities/getEsData.sh
0 → 100644
+
20
−
0
View file @
35da079d
#!/bin/bash
####################################################
# Author S M Y ALTAMASH <smy.altamash@gmail.com> #
# Script gets the Latest Logs of proxy from Log-es #
####################################################
# NOTE: Have jq installed before running this script
for
index
in
$(
curl
-s
localhost:9200/_cat/indices |
grep
-v
kibana |
awk
'{print $3}'
|
tr
"
\n
"
" "
)
;
do
echo
"Index:
$index
"
# Get the Total Hits for the Proxy Container
hits
=
$(
curl
-s
-X
GET
"http://localhost:9200/
$index
/_search?pretty"
-H
'Content-Type: application/json'
-d
'{"query":{"match":{"program":"proxy_proxy*"}}}'
| jq
'.hits.total'
)
# Increase the query size
curl
-XPUT
"http://localhost:9200/
$index
/_settings"
-d
"{
\"
index
\"
: {
\"
max_result_window
\"
:
\"
$hits
\"
} }"
-H
"Content-Type: application/json"
# Save the Logs in the file
curl
-s
-X
GET
"http://localhost:9200/
$index
/_search?size=
$hits
"
-H
'Content-Type: application/json'
-d
'{"query":{"match":{"program":"proxy_proxy*"}}}'
>
$index
.json
echo
"################################"
done
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets