-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add utility to make it easier to get stuff from es #337
Conversation
[test] |
can pass ENV vars like:
|
elasticsearch/es_util
Outdated
SIZE=${SIZE:-10} | ||
SORT=${SORT:-"@timestamp:desc"} | ||
|
||
BASE=https://logging-es:9200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BASE=${BASE:-https://localhost:9200}
since you are running this inside the same pod that ES is running, you can use localhost
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
elasticsearch/es_util
Outdated
@@ -0,0 +1,19 @@ | |||
#/bin/bash -x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest -euxo pipefail
elasticsearch/es_util
Outdated
|
||
BASE=https://logging-es:9200 | ||
|
||
if [ -z $QUERY ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"${QUERY:-}"
when using -u.
elasticsearch/es_util
Outdated
|
||
URL="$BASE/$INDEX" | ||
|
||
curl -s -k --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key $URL | python -mjson.tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you use $QUERY
?
elasticsearch/es_util
Outdated
BASE=https://logging-es:9200 | ||
|
||
if [ -z $QUERY ]; then | ||
QUERY="$INDEX/_search?size=$SIZE\&sort=$SORT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want $INDEX
in $QUERY
?
would it be easier if we just created an alias for the |
@ewolinetz I'm not sure I understand what you are suggesting. |
6995825
to
7acb01d
Compare
Evaluated for aggregated logging test up to 7acb01d |
@richm updated to address your comments |
Aggregated Logging Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test-origin-aggregated-logging/1184/) (Base Commit: 0bdc7e5) |
[merge] |
Evaluated for aggregated logging merge up to 7acb01d |
Aggregated Logging Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test-origin-aggregated-logging/1185/) (Base Commit: 0bdc7e5) |
Simplifies getting project index data from es. Call like:
oc exec POD -- bash es_util
I don't know how to pass ENV vars with the command so the only way to change any of them would be to provide actual args. Suggestions?